FireDAC.Comp.Client.TFDConnection.Connected
Delphi
property Connected;
C++
__property Connected = {default=0};
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | published | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp |
FireDAC.Comp.Client | TFDConnection |
Description
Determines whether a connection has been established to the remote source of data and is active.
FireDAC.Comp.Client.TFDConnection.Connected inherits from Data.DB.TCustomConnection.Connected. All content below this line refers to Data.DB.TCustomConnection.Connected.
Determines whether a connection has been established to the remote source of data and is active.
Set Connected to True to open the connection. Set Connected to False to terminate the connection.
Setting Connected to True generates a BeforeConnect event, calls the protected DoConnect method to establish the connection, and generates an AfterConnect event. In addition, when setting Connected to True TCustomConnection may display a login dialog, depending on the value of LoginPrompt.
Setting Connected to False generates a BeforeDisconnect event, calls the protected DoConnect method to drop the connection, and generates an AfterDisconnect event.
When deriving custom connection components from TCustomConnection, override GetConnected to return True when a connection is established, and override DoConnect and DoDisconnect to create and drop the connection.