Logging into Connections
A login occurs after the connections are registered. This should occur before tables using the connection are opened. Most typically, this is done by sending a message to log in to all registered connections. There are a variety of public interfaces that can be used to log into a connection. We will start with the highest level and work our way down.
LoginAll
LoginAll logs in to all managed connections. If this fails, an error is reported and the application is aborted. It does this by calling the LoginAllConnections function. This is called by AutoConnect (when pbAutoConnect is True).
LoginAllConnections
LoginAllConnections is a function that attempts to log in to all managed connections. If this fails, an error status is returned, which you must handle yourself. This logs in to each connection by calling the LoginConnectionId function.
LoginConnectionId
LoginConnectionId attempts to log in the connection identified by the passed Connection ID. If the login fails, error information is stored and an error code is returned. If the connection is already logged in (IsConnectionIdLoggedIn), the login can be skipped (pbSkipDuplicateLogin). It performs the login by calling LoginConnectIdBase.
LoginConnectIdBase
LoginConnectIdBase attempts the actual login. First, it attempts a silent login, using the credentials that were defined during the add connection process. If this fails, it calls LoginConnectIdDialog, which will optionally pop up a database login dialog. If this fails, it returns an error code.
LoginConnectIdDialog
This will pop up a database login dialog, which will allow the user to log in and store the login credentials. It returns an error code. This is controlled by pbLoginDialogRequired. If false, no login attempt occurs. If true, this will send LoginConnectIdDialog to the database login dialog. This dialog is identified by the ghoLoginConnectDialog property, which must be set when pbLoginDialogRequired is true. This is normally set by the database login dialog when it is created, which is typically done by adding the DatabaseLoginDialog.dg package to your application.