FireDAC.Comp.Client.TFDCustomConnection.DriverName
Delphi
property DriverName: String read GetDriverName write SetDriverName stored False;
C++
__property System::UnicodeString DriverName = {read=GetDriverName, write=SetDriverName, stored=false};
Contents
Properties
Type | Visibility | Source | Unit | Parent |
---|---|---|---|---|
property | public | FireDAC.Comp.Client.pas FireDAC.Comp.Client.hpp |
FireDAC.Comp.Client | TFDCustomConnection |
Description
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');