AnyDAC
ContentsIndexHome
PreviousUpNext
TADQuery.ConnectionName Property

Specifies the AnyDAC connection to use by its name.

Group
Links

Use ConnectionName to specify an AnyDAC connection to use to connect to an DBMS. The ConnectionName property value specifies the name of the connection. It must match to the:

  • name of one of connection definitions, either stored in external file (persistent) or created on fly (private);
  • ConnectionName of one of the TADConnection objects.

The ConnectionName property value must be specified before Prepare call. If it matches the name of one of connection definitions, then AnyDAC will transparently create connection object and link the dataset with it. 

The TADRdbmsDataSet cab be bind to TADCustomConnection object using Connection or ConnectionName property. Using Connection property allows to bind to a connection object explicitly and reduce the overhead for resolving connection names.

property ConnectionName: String;
ADQuery1.ConnectionName := 'Ora_Demo';
ADQuery1.Open('select * from "Customers"');
What do you think about this topic? Send feedback!