FireDAC.Comp.Client.TFDCustomConnection.Offline
Delphi
procedure Offline;
C++
void __fastcall Offline();
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
procedure function |
public | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp |
FireDAC.Comp.Client | TFDCustomConnection |
Description
Sets the connection to offline mode.
The Offline method disconnects the datasets associated with this connection from the DBMS, but does not close them. It then closes the connection to the DBMS by implicitly setting Connected to False.
After the call, the dataset continues to work as an in-memory dataset and you can perform with the dataset any client operation that does not require a DBMS, such as browsing. When an application in offline mode tries to perform any operation that requires communication with the DBMS, the following happen:
- When ResourceOptions.AutoConnect is True, then the Online method is called, trying to establish a connection to the DBMS.
- When ResourceOptions.AutoConnect is False, then an exception is raised.
To bring the connection and associated datasets to the online state, call the Online method.
Calling the Offline method is the same as setting Offlined to True.
Example
FDConnection1.Offline;
lblState.Caption := '<not connected>';