WillConnect (ConnectionEvent) Method (ADO)

See Also   Applies To

This method is called before a connection starts. The parameters to be used in the pending connection are supplied as input parameters and can be changed before the method returns. This method may return a request that the pending connection be canceled.

Syntax

WillConnect ConnectionString, UserID, Password, Options, adStatus, pConnection

Parameters

ConnectionString   A String containing connection information for the pending connection.

UserID   A String containing a user name for the pending connection.

Password   A String containing a password for the pending connection.

Options   A Long value that indicates how the provider should evaluate the ConnectionString. See the CommandType property for a list of acceptable values.

adStatus   An EventStatusEnum status value.

When this method is called, this parameter is set to adStatusOK if the operation that caused the event was successful. This parameter is set to adStatusCantDeny if this method cannot request cancellation of the pending operation.

Before this method returns, set this parameter to adStatusUnwantedEvent to prevent subsequent notifications. Set this parameter to adStatusCancel to request the connection operation that caused cancellation of this notification.

pConnection   The Connection object for which this event notification applies.

Remarks

When this method is called, the ConnectionString, UserID, Password, and Options parameters are set to the values established by the operation that caused this event.

When this method is canceled, ConnectComplete will be called with its adStatus parameter set to adStatusErrorsOccurred.