Adding Connections
Before you use a managed connection, you must define and initialize that connection. Most typically, this is done by reading the connections INI file and registering all active connections in this file. There are a variety of public interfaces that can be used to add a connection. We will start with the highest level and work our way down.
RegisterAllConnections
RegisterAllConnections is a procedure that reads all connections and registers all active connections. If this fails, an error is reported and the application is aborted. It does this by calling the AddAllConnections function. This is called by AutoConnect (when pbAutoConnect is True).
AddAllConnections
AddAllConnections is a function that reads all connections and registers all active connections. If this fails, an error status is returned, which you must handle yourself (see Error Handling in Managed Connections). This function loads an array of managed connections by calling LoadStoredConnections. By default, this will load all enabled connections from the Connections INI file. It then calls AddConnection for each active connection in the array.
AddConnection
AddConnection is passed all of the parameters needed to register a managed connection. It is called by AddAllConnections. This can be called by the developer as part of a custom managed connection strategy.
LoadStoredConnections
LoadStoredConnections is called to load an array of managed connections from a stored source. By default, it loads all connections from the connections INI file. Each array item is a struct containing all information for a connection. The password for a connection must be returned decrypted. This is done within LoadStoredConnections by calling DecryptPassword. The connections returned are the connections from a stored source and are not yet registered. The connections array may contain enabled and disabled connections. The enabled connections are registered when the connection is actually added (AddConnection). LoadStoredConnections is called by AddAllConnections.
This can be augmented to load managed connections from alternate sources.