Name

Connection.WillConnect Event — (Versions 2.0, 2.1, 2.5, 2.6)

Synopsis

Private Sub WillConnect(ConnectionString As String, _
                        UserID As String, _
                        Password As String, _
                        Options As Long, _
                        adStatus As ADODB.EventStatusEnum, _
                        ByVal pConnection As ADODB.Connection)

The WillConnect event is raised before a connection is made.

Arguments

ConnectionString (String)

Contains the connection information for the awaiting connection operation.

UserID (String)

Contains the username for the awaiting connection operation.

Password (String)

Contains the password for the awaiting connection operation.

Options (Long)

Indicates how the ConnectionString parameter should be evaluated. For this parameter, the only valid value is adAsyncOpen.

adStatus (EventStatusEnum)

Indicates the status of the current operation. The adStatus parameter is set to adStatusOK if the operation causing this event was successful. If the adStatus parameter is set to adStatusCantDeny, the event cannot request that the operation be canceled. If the adStatus parameter is set to adStatusUnwantedEvent, this event will not be called again. If the adStatus parameter is set to adStatusCancel, a cancelation request will be made for this operation.

pConnection

Represents the Connection object that fired this event.

Note

The ConnectionString, UserID, and Password parameters can be changed by the application within this event before the operation finishes execution.

See Also

Connection.ConnectComplete Event, EventStatusEnum Enumeration

Get ADO: ActiveX Data Objects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.