Gets / sets connection active status.
Set Connected to True to establish a connection to a DBMS. Set Connected to False to close a connection. The default value for Connected is False.
An application can check Connected to determine the current status of a connection. If Connected is True, the connection is active; if False, and the KeepConnection property is also False, then the connection is inactive.
To open connection, it must be setup in one of the following ways:
When the connection definition is pooled (Pooled=True), then use (1) and does not override any of parameters, otherwise you will get an exception.
Setting Connected to False will try to connect to a DB. If somehow the connecting fails, then Connected will remain False and an an exception will be raised. If connecting failed due to a DB unavailability, then application may use Automatic Connection Recovery feature to wait and try to establish the connection.
Setting Connected to False will disconnect (close and unprepare) all associated commands and datasets. If you just need to disconnect from DBMS, but does not close objects, then use Offlined property.
ADConnection1.ConnectionDefName := 'ASA_Demo'; ADConnection1.Connected := True;
What do you think about this topic? Send feedback!