FireDAC.Comp.Client.TFDTable.ConnectionName

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property ConnectionName;

C++

__property ConnectionName = {default=0};

Properties

Type Visibility Source Unit Parent
property published
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
FireDAC.Comp.Client TFDTable

Description

Specifies the FireDAC connection to use by its name.

FireDAC.Comp.Client.TFDTable.ConnectionName inherits from FireDAC.Comp.Client.TFDRdbmsDataSet.ConnectionName. All content below this line refers to FireDAC.Comp.Client.TFDRdbmsDataSet.ConnectionName.

Specifies the FireDAC connection to use by its name.

Use ConnectionName to specify a FireDAC connection to use in order to connect to a DBMS. The ConnectionName property value specifies the name of the connection. It must match the:

  • Name of one of the connection definitions, either stored in an external file (persistent) or created on the fly (private).
  • ConnectionName of one of the TFDConnection objects.

The ConnectionName property value must be specified before the Prepare call. If it matches the name of one of the connection definitions, FireDAC will transparently create a connection object and link the dataset to it. TFDRdbmsDataSet can be bound to a TFDCustomConnection 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.

Example

FDQuery1.ConnectionName := 'Ora_Demo';
FDQuery1.Open('select * from "Customers"');

See Also