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, _ ByValpConnection
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 toadStatusOK
if the operation causing this event was successful. If theadStatus
parameter is set toadStatusCantDeny
, the event cannot request that the operation be canceled. If theadStatus
parameter is set toadStatusUnwantedEvent
, this event will not be called again. If theadStatus
parameter 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
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.