Name
Connection.WillConnect Event — (Versions 2.0, 2.1, 2.5, 2.6)
Synopsis
Private Sub WillConnect(ConnectionStringAs String, _UserIDAs String, _PasswordAs String, _OptionsAs Long, _adStatusAs ADODB.EventStatusEnum, _ ByValpConnectionAs 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
adStatusparameter is set toadStatusOKif the operation causing this event was successful. If theadStatusparameter is set toadStatusCantDeny, the event cannot request that the operation be canceled. If theadStatusparameter is set toadStatusUnwantedEvent, this event will not be called again. If theadStatusparameter is set toadStatusCancel, 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
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access