IDADriver40

Overview

Sometimes, drivers can work with more than one database. Initialization parameters are usually different for each database, so drivers should properly initialize them.

IDADriver40 is designed for such purposes, i.e. it returns default initialization parameters for each driver provider. Schema Modeler asks drivers for this interface and, if they support, fills custom driver-dependent parameters for the specified provider. In runtime, these parameters can be received via the TDADriverManager:

var
  i,j: integer;
  drv: IDADriver;
  drv40:IDADriver40;
  list: IROStrings;
begin 
  for i := 0 to (DADriverManager.DriverCount - 1) do begin
    drv := DADriverManager.Drivers[i];
    if Supports(drv,IDADriver40,drv40) then begin
      drv.GetAuxDrivers(list);
      for j := 0 to List.Count - 1 do
        Log(drv.DriverID+','+ list[j] + ' = ' + drv40.GetProviderDefaultCustomParameters(list[j]));    
    end;
  end;

Above code returns:

  • ADO,SQLOLEDB.1 = Integrated Security=SSPI;
  • ADO,SQLNCLI.1 = Schemas=1;Integrated Security=SSPI;
  • ADO,SQLNCLI10.1 = Schemas=1;Integrated Security=SSPI;

Location

 

Description    (declared in IDADriver)

Driver's description.

property Description: string read write

DriverID    (declared in IDADriver)

Returns the driver's ID.

property DriverID: string read write

Finalize  safecall    (declared in IDADriver)

Initializes the driver

procedure Finalize

GetAuxDrivers  safecall    (declared in IDADriver)

Returns a list of available auxiliary drivers.

procedure GetAuxDrivers(out List: IROStrings)

Parameters:

  • List: List of auxiliary driver names

GetAuxParams  safecall    (declared in IDADriver)

Returns a list of custom parameters for the specified driver.

procedure GetAuxParams(const AuxDriver: string; out List: IROStrings)

Parameters:

  • AuxDriver: Aux driver name in question
  • List: List of auxiliary parameters

GetAvailableDriverOptions  safecall    (declared in IDADriver)

Returns a set of available driver options.

function GetAvailableDriverOptions: TDAAvailableDriverOptions

GetAvailableDriverOptionsEx  safecall    (declared in IDADriver)

Returns a set of available driver options for specific provider.

function GetAvailableDriverOptionsEx(AuxDriver: string): TDAAvailableDriverOptions

Parameters:

  • AuxDriver: Aux driver name in question

GetDefaultConnectionType  safecall    (declared in IDADriver)

Returns a default connection type of the specified provider.

function GetDefaultConnectionType(const AuxDriver: string): string

Parameters:

  • AuxDriver: Aux driver name in question

GetDefaultCustomParameters  safecall    (declared in IDADriver)

Returns custom driver-dependent parameters. If the driver supports multiple providers, it should use the GetProviderDefaultCustomParameters instead.

function GetDefaultCustomParameters: string

GetDriverHelp    (declared in IDADriver30)

Returns the help of the driver.

function GetDriverHelp(aType: TDADriverHelpType): string

Parameters:

  • aType: driver help type.

GetProviderDefaultCustomParameters  safecall

Returns custom driver-dependent parameters for the specified Aux drivers

function GetProviderDefaultCustomParameters(Provider: string): string

Parameters:

  • Provider: given provider

Initialize  safecall    (declared in IDADriver)

Initializes the driver

procedure Initialize

MajVersion    (declared in IDADriver)

Driver's major version.

property MajVersion: byte read write

MinVersion    (declared in IDADriver)

Driver's minor version.

property MinVersion: byte read write

NewConnection (IDAConnectionManager, TDAConnection): IDAConnection  safecall overload    (declared in IDADriver)

Creates a new connection with gives parameters

function NewConnection(const aConnectionManager: IDAConnectionManager; aConnectionDefinition: TDAConnection): IDAConnection

Parameters:

  • aConnectionManager: Connection manager
  • aConnectionDefinition: Connection parameters

NewConnection (string, string): IDAConnection  safecall overload    (declared in IDADriver)

Creates a new connection with gives parameters

function NewConnection(const aName: string; const aConnectionType: string): IDAConnection

Parameters:

  • aName: Connection name
  • aConnectionType: Connection type

SetTraceOptions  safecall    (declared in IDADriver)

Sets trace options.

  TDATraceOption = (toPrepare, toExecute, toFetch, toError, toStmt, toConnect, toTransact, toBlob, toService, toMisc, toParams);
  TDATraceOptions = set of TDATraceOption;
  TDALogTraceEvent = procedure(Sender: TObject; const Text: string; Tag: integer) of object;
procedure SetTraceOptions(TraceActive: boolean; TraceOptions: TDATraceOptions; Callback: TDALogTraceEvent)

Parameters:

  • TraceActive: Current mode
  • TraceOptions: Set of TDATraceOption
  • Callback: Method to call in various OnTraceEvent event handlers

 

Description    (declared in IDADriver)

Driver's description.

property Description: string read write

DriverID    (declared in IDADriver)

Returns the driver's ID.

property DriverID: string read write

MajVersion    (declared in IDADriver)

Driver's major version.

property MajVersion: byte read write

MinVersion    (declared in IDADriver)

Driver's minor version.

property MinVersion: byte read write

 

Finalize  safecall    (declared in IDADriver)

Initializes the driver

procedure Finalize

GetAuxDrivers  safecall    (declared in IDADriver)

Returns a list of available auxiliary drivers.

procedure GetAuxDrivers(out List: IROStrings)

Parameters:

  • List: List of auxiliary driver names

GetAuxParams  safecall    (declared in IDADriver)

Returns a list of custom parameters for the specified driver.

procedure GetAuxParams(const AuxDriver: string; out List: IROStrings)

Parameters:

  • AuxDriver: Aux driver name in question
  • List: List of auxiliary parameters

GetAvailableDriverOptions  safecall    (declared in IDADriver)

Returns a set of available driver options.

function GetAvailableDriverOptions: TDAAvailableDriverOptions

GetAvailableDriverOptionsEx  safecall    (declared in IDADriver)

Returns a set of available driver options for specific provider.

function GetAvailableDriverOptionsEx(AuxDriver: string): TDAAvailableDriverOptions

Parameters:

  • AuxDriver: Aux driver name in question

GetDefaultConnectionType  safecall    (declared in IDADriver)

Returns a default connection type of the specified provider.

function GetDefaultConnectionType(const AuxDriver: string): string

Parameters:

  • AuxDriver: Aux driver name in question

GetDefaultCustomParameters  safecall    (declared in IDADriver)

Returns custom driver-dependent parameters. If the driver supports multiple providers, it should use the GetProviderDefaultCustomParameters instead.

function GetDefaultCustomParameters: string

GetDriverHelp    (declared in IDADriver30)

Returns the help of the driver.

function GetDriverHelp(aType: TDADriverHelpType): string

Parameters:

  • aType: driver help type.

GetProviderDefaultCustomParameters  safecall

Returns custom driver-dependent parameters for the specified Aux drivers

function GetProviderDefaultCustomParameters(Provider: string): string

Parameters:

  • Provider: given provider

Initialize  safecall    (declared in IDADriver)

Initializes the driver

procedure Initialize

NewConnection (IDAConnectionManager, TDAConnection): IDAConnection  safecall overload    (declared in IDADriver)

Creates a new connection with gives parameters

function NewConnection(const aConnectionManager: IDAConnectionManager; aConnectionDefinition: TDAConnection): IDAConnection

Parameters:

  • aConnectionManager: Connection manager
  • aConnectionDefinition: Connection parameters

NewConnection (string, string): IDAConnection  safecall overload    (declared in IDADriver)

Creates a new connection with gives parameters

function NewConnection(const aName: string; const aConnectionType: string): IDAConnection

Parameters:

  • aName: Connection name
  • aConnectionType: Connection type

SetTraceOptions  safecall    (declared in IDADriver)

Sets trace options.

  TDATraceOption = (toPrepare, toExecute, toFetch, toError, toStmt, toConnect, toTransact, toBlob, toService, toMisc, toParams);
  TDATraceOptions = set of TDATraceOption;
  TDALogTraceEvent = procedure(Sender: TObject; const Text: string; Tag: integer) of object;
procedure SetTraceOptions(TraceActive: boolean; TraceOptions: TDATraceOptions; Callback: TDALogTraceEvent)

Parameters:

  • TraceActive: Current mode
  • TraceOptions: Set of TDATraceOption
  • Callback: Method to call in various OnTraceEvent event handlers