BeforeConnect Event

       

Occurs just before RDO calls the ODBC API SQLDriverConnect function to establish a connection to the server.

Syntax

Private Sub object.BeforeConnect(ConnectString as String, Prompt as Variant)

The BeforeConnect event syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
ConnectString A Variant expression that evaluates to a connect string used to provide connect parameters for the ODBC SQLDriverConnect function.
Prompt Determines how the user should be prompted.

Remarks

The BeforeConnect event is fired just before RDO calls the ODBC API SQLDriverConnect function to establish a connection to the server. This event gives your code an opportunity to provide custom prompting, or just provide or capture connection information.

The ConnectString parameter is the ODBC connect string RDO will pass to the ODBC API SQLDriverConnect function. This string can be changed during this event, and RDO will use the changed value. For example, your code can provide additional parameters, or change existing parameters of the connect string.

The Prompt parameter is the ODBC prompting constant (see the Prompt property). This parameter will default to the value of the Prompt parameter passed in the OpenConnection or EstablishConnection methods. The developer may change this value, and RDO will use the new value when calling SQLDriverConnect.