FireDAC.Comp.Client.TFDRdbmsDataSet.ConnectionName

From RAD Studio API Documentation
Jump to: navigation, search

[–] Properties
Type: property
Visibility: public
Source:
FireDAC.Comp.Client.pas
FireDAC.Comp.Client.hpp
Unit: FireDAC.Comp.Client
Parent: TFDRdbmsDataSet

Delphi

property ConnectionName: String read GetConnectionName write SetConnectionName stored IsCNNS;

C++

__property System::UnicodeString ConnectionName = {read=GetConnectionName, write=SetConnectionName, stored=IsCNNS};

Description

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