Data.Win.ADODB.TADOConnection.OnWillConnect

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property OnWillConnect: TWillConnectEvent read FOnWillConnect write FOnWillConnect;

C++

__property TWillConnectEvent OnWillConnect = {read=FOnWillConnect, write=FOnWillConnect};

Properties

Type Visibility Source Unit Parent
event published
Data.Win.ADODB.pas
Data.Win.ADODB.hpp
Data.Win.ADODB TADOConnection

Description

Occurs after a request to start a connection.

Write an OnWillConnect event handler to take specific action before a connection starts and after the provider indicates the connection attempt can be made. The OnWillConnect event fires after the corresponding operation (requesting a connection attempt) has executed at the ADO Connection object. Calling the Open method or setting the Connected property to true will lead to this event occurring.

Connection indicates the TADOConnection component attempting the connection.

ConnectionString contains the connection information for the pending connection.

UserID contains the user identification for the pending connection.

Password contains the password for the pending connection.

ConnectionOptions contains the TConnectOption value that describes how the provider is to evaluate the connection string for the pending connection.

The EventStatus value (ADO EventStatusEnum) indicates the success or failure of the execution of the operation that triggered the event. In a handler for this event, set this parameter to esCancel to request cancellation of the pending connection operation.

See Also