FireDAC.Comp.Client.TFDConnection.DriverName

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

property DriverName: string read GetDriverName write SetDriverName stored False default 0;

C++

__property DriverName = {default=0};

Properties

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

Description

Specifies the ID of the FireDAC driver for the connection.

FireDAC.Comp.Client.TFDConnection.DriverName inherits from FireDAC.Comp.Client.TFDCustomConnection.DriverName. All content below this line refers to FireDAC.Comp.Client.TFDCustomConnection.DriverName.

Specifies the ID of the FireDAC driver for the connection.

Use DriverName to specify the ID of the FireDAC driver to use for connections that do not specify a ConnectionDefName. DriverName must be a valid FireDAC registered driver ID. 

If an application sets DriverName, it must also specify the connection parameters in the Params property.

Ordinarily, the alias specified in the ConnectionDefName property supplies connection parameters, but when DriverName is set, the ConnectionDefName property is automatically cleared to avoid FireDAC driver ID contention. 

Attempting to set DriverName when the Connected property is True raises an exception. 

Setting the DriverName value adds the DriverID=<xxx> parameter to the Params list.

You can choose DriverName in two ways:

  • At design time, double-click a TConnection component to invoke the Connection editor and set the DriverName.
  • Select the DriverName value in the property inspector from the drop-down list.

Example

FDConnection1.DriverName := 'Oracle';
FDConnection1.Params.Add('Database=testdb');
....
FDQuery1.Connection := FDConnection1;
FDQuery1.Open('select * from test_tab');

See Also