The WillConnect event is called before a connection starts.
WillConnect ConnectionString, UserID, Password, Options, adStatus, pConnection
When this event is called, this parameter is set to adStatusOK by default. It is set to adStatusCantDeny if the event cannot request cancellation of the pending operation.
Before this event 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.
When WillConnect is called, the ConnectionString, UserID, Password, and Options parameters are set to the values established by the operation that caused this event (the pending connection), and can be changed before the event returns. WillConnect may return a request that the pending connection be canceled.
When this event is canceled, ConnectComplete will be called with its adStatus parameter set to adStatusErrorsOccurred.
Applies To: Connection Object