Barvna shema: Svetla
Trenutno dejavna stran: start » en » Documentation » Microsoft Access development tools » WKL Forms Object Library » WKL Forms Object Library how-to guides » How to: Let operators move the connections of a delivered application

How to: Let operators move the connections of a delivered application

Let the person who runs a delivered application point its linked tables to another server or database - a new SQL Server, a test database - without development access and without a new version.

Requires WKL Forms Object Library 1.51 or later; the tables are linked through WklLinkManager.

Solution overview

The application model releases what may be adjusted in operation: Verbindungen umstellen (relinking) and named options. WklApplication.ShowSettings opens a small dialog with these settings only - also in an ACCDE and the Access Runtime, where no designer is available. OK writes the values that differ into the user's settings file outside the database and relinks the tables through WklLinkManager.EnsureLinks. At every later start, EnsureLinks uses the same file, and a new version of the application keeps it.

Implementation

  1. In the application designer, page Im Betrieb anpassbar, switch on Verbindungen umstellen. Optionally add options (for example Branch, kind Auswahl, values Wien;Graz) and fill in Wer die Einstellungen öffnen darf, for example a function IsAdministrator of the application.
  2. Give the operator a way to open the settings, for example a button in the shell:

    Private Sub cmdSettings_Click()
        On Error GoTo Failed
        If CreateObject("WklForms.Application").ShowSettings() Then
            Me.Requery
        End If
        Exit Sub
    Failed:
        MsgBox Err.Description, vbExclamation
        Resume Done
    Done:
    End Sub
  3. Relink at every start, before the first form reads data (the start form or an AutoExec macro):

    CreateObject("WklForms.LinkManager").EnsureLinks
  4. Read an option where the application needs it: CreateObject("WklForms.Application").OptionValue("Branch").

Remarks

  • Where the values live: per user in %LOCALAPPDATA%\WKL\<database>\settings.json, over the machine's %ProgramData%\WKL\<database>\settings.json, which an administrator can roll out. Only values that differ from the database are written; a connection is matched by its name.
  • A damaged file is reported by EnsureApplication and ignored: the application starts with the connections stored in the database.
  • Refused openings raise wkeNotAvailable without a dialog: when the model releases nothing, or the condition does not hold for this user.
en/wiki/msaccess/comctl/how-to/let-operators-move-the-connections.txt · Zadnja sprememba: uporabnika Wolfgang van der Stille