TDAEConnection

Overview

TDAEConnection manipulates the database and retrieves information about available databases, tables, columns, etc.

TDAEConnection is not used directly. Instead, IDAConnection is used in runtime for working with the TDAEConnection instance.

TDAEConnection also contains references to the TDAEDataset and TDAEStoredProcedure classes.

By default, TDAEConnection supports IDAConnection, IDACustomConnection, IDAConnectionObjectAccess, IDATestableObject and IDAHasMacroProcessor, so that required interfaces can be received as:

  
//id: IDAConnection
//it: IDATestableObject
  if Supports(id, IDATestableObject, it) then it.Test;    

Also see How to create a Data Abstract Driver (Delphi).

Location

Implements

 

constructor Create  virtual

Creates a new instance.

constructor Create(aDriver: TDAEDriver; aName: string)

Parameters:

  • aDriver: owner driver.
  • aName: name of connection.

ApplyConnectionString  protected

Parses connection string.

procedure ApplyConnectionString(const aConnectionString: string; aConnectionObject: TCustomConnection)

Parameters:

  • aConnectionString: Connection string
  • aConnectionObject: Connection

AssignCommandEventHandlers  protected

Assigns OnBeforeExecute, OnAfterExecute and OnExecuteError events to correspondent events of aCommand

procedure AssignCommandEventHandlers(const aCommand: IDASQLCommand)

Parameters:

  • aCommand: Command

AssignDatasetEventHandlers  protected

Assigns OnBeforeOpen, OnAfterOpen and OnExecuteOpen events to correspondent events of aDataset

procedure AssignDatasetEventHandlers(const aDataset: IDADataset)

Parameters:

  • aDataset: Dataset

BeginTransaction  protected safecall

Starts transaction via calling of DoBeginTransaction.

function BeginTransaction: integer

Close  protected safecall

Closes a physical connection to the database back-end,

procedure Close

CommitTransaction  protected safecall

Commits transaction via calling of DoCommitTransaction.

procedure CommitTransaction

Connected  protected

Indicates whether the connection object currently has an active link to the database (true) or not (false). Usually, a Data Abstract connection connects to the database when it is created, and is not closed until discarded and eventually removed from the connection pool.

property Connected: boolean read write

ConnectionDefinition  protected

Holds a reference to the TDAConnection

property ConnectionDefinition: TDAConnection read write

ConnectionManager  protected

Holds a reference to the IDAConnectionManager.

property ConnectionManager: IDAConnectionManager read write

ConnectionName  protected

Holds the connection name.

property ConnectionName: string read write

ConnectionObject  protected

Provides access to the internal connection component and facilitates access to its properties in form of a collection of properties.

property ConnectionObject: TCustomConnection read write

ConnectionPool

Provides access to the IDAConnectionPool.

property ConnectionPool: IDAConnectionPool read write

ConnectionProperties  protected

Returns value of given property

property ConnectionProperties[aPropertyName: string]: Variant read write

ConnectionString  protected

Sets the database connection string that was used to open this connection. The exact content of this string depends on the driver and database you are using, but it will usually contain information such as the database name, user id and password, as well as additional connection parameters. Please refer to the reference for the specific driver for more details.

property ConnectionString: string read write

ConnectionType  protected

Holds the connection type.

property ConnectionType: string read write

CreateCustomConnection  protected virtual abstract

Creates standard TCustomConnection

function CreateCustomConnection: TCustomConnection

CreateMacroProcessor  protected virtual

Creates a macro processor.

function CreateMacroProcessor: TDASQLMacroProcessor

DoBeginTransaction  protected virtual abstract

Starts transaction.

function DoBeginTransaction: integer

DoCommitTransaction  protected virtual abstract

Commits transaction.

procedure DoCommitTransaction

DoGetForeignKeys  protected virtual safecall

Fills ForeignKeys with actual foreign keys.

procedure DoGetForeignKeys(out ForeignKeys: TDADriverForeignKeyCollection)

Parameters:

  • ForeignKeys: collection that will be filled.

DoGetInTransaction  protected virtual abstract

Returns the transaction state.

function DoGetInTransaction: boolean

DoGetLastAutoInc  protected virtual

Returns last auto increment value.

function DoGetLastAutoInc(const GeneratorName: string): integer

Parameters:

  • GeneratorName: Specified generator name.

DoGetLastAutoIncValue  protected virtual

Returns last auto increment value.

function DoGetLastAutoIncValue(const GeneratorName: string): Variant

Parameters:

  • GeneratorName: Specified generator name.

DoGetQueryFields  protected virtual safecall

Returns the fields of a specified SQL.

procedure DoGetQueryFields(const aSQL: string; aParamsIfNeeded: TDAParamCollection; out Fields: TDAFieldCollection)

Parameters:

  • aSQL: given SQL
  • aParamsIfNeeded: optional parameters
  • Fields: fields of SQL

DoGetStoredProcedureNames  protected virtual safecall

Returns the list of stored procedures names.

procedure DoGetStoredProcedureNames(out List: IROStrings)

Parameters:

  • List: Output list with names of stored procedures

DoGetStoredProcedureParams  protected virtual safecall

Retrieves the stored procedure params.

procedure DoGetStoredProcedureParams(const aStoredProcedureName: string; out Params: TDAParamCollection)

Parameters:

  • aStoredProcedureName: Stored procedure name
  • Params: Output collection of parameters

DoGetTableFields  protected virtual safecall

Returns the fields of a specified table.

procedure DoGetTableFields(const aTableName: string; out Fields: TDAFieldCollection)

Parameters:

  • aTableName: Specified data table name
  • Fields: Output collection of data table fields

DoGetTableNames  protected virtual safecall

Returns the list of tables names.

procedure DoGetTableNames(out List: IROStrings)

Parameters:

  • List: Output list of data table names

DoGetViewFields  protected virtual safecall

Returns the fields of a specified view.

procedure DoGetViewFields(const aViewName: string; out Fields: TDAFieldCollection)

Parameters:

  • aViewName: Specified view name
  • Fields: Output collection of data table fields

DoGetViewNames  protected virtual safecall

Returns the list of view names.

procedure DoGetViewNames(out List: IROStrings)

Parameters:

  • List: Output list of views

DoRollbackTransaction  protected virtual abstract

Rollbacks the transaction.

procedure DoRollbackTransaction

Driver

Reference to the owner TDAEDriver.

property Driver: TDAEDriver read write

GetConnected  protected virtual safecall

Returns connection state.

function GetConnected: boolean

GetDatasetClass  protected virtual

Returns the actual TDAEDatasetClass descendant.

function GetDatasetClass: TDAEDatasetClass

GetForeignKeys  protected safecall

Fills ForeignKeys with actual foreign keys via calling of DoGetForeignKeys.

procedure GetForeignKeys(out ForeignKeys: TDADriverForeignKeyCollection)

Parameters:

  • ForeignKeys: collection that will be filled.

GetInTransaction  protected safecall

Returns the transaction state via calling of DoGetInTransaction.

function GetInTransaction: boolean

GetLastAutoInc  protected safecall

Returns last auto increment value as integer value via calling of DoGetLastAutoInc

function GetLastAutoInc(const GeneratorName: string): integer

Parameters:

  • GeneratorName: Specified generator name.

GetLastAutoIncValue  protected safecall

Returns last auto increment value as variant value via calling of DoGetLastAutoIncValue

function GetLastAutoIncValue(const GeneratorName: string): variant

Parameters:

  • GeneratorName: Specified generator name.

GetName  protected safecall

Return the connection name.

function GetName: string

GetQueryBuilder  protected virtual safecall

Creates an instance of the TDAQueryBuilder.

function GetQueryBuilder: TDAQueryBuilder

GetQueryFields  protected safecall

Returns the fields of a specified SQL via calling of DoGetQueryFields

procedure GetQueryFields(const aSQL: string; aParamsIfNeeded: TDAParamCollection; out Fields: TDAFieldCollection)

Parameters:

  • aSQL: given SQL
  • aParamsIfNeeded: optional parameters
  • Fields: fields of SQL

GetQuoteChars  protected virtual safecall

Returns quote symbols as an array.

function GetQuoteChars: TDAQuoteCharArray

GetSPSelectSyntax  protected virtual safecall

Returns the syntax of a stored procedure for usage in a select query.

function GetSPSelectSyntax(HasArguments: Boolean): string

Parameters:

  • HasArguments: parameters are present or not

GetStoredProcedureClass  protected virtual

Returns the actual TDAEStoredProcedure descendant.

function GetStoredProcedureClass: TDAEStoredProcedureClass

GetStoredProcedureNames  protected safecall

Returns the list of stored procedures names via calling of DoGetStoredProcedureNames.

procedure GetStoredProcedureNames(out List: IROStrings)

Parameters:

  • List: list of stored procedures names

GetStoredProcedureParams  protected safecall

Retrieves the stored procedure params.

procedure GetStoredProcedureParams(const aStoredProcedureName: string; out Params: TDAParamCollection)

Parameters:

  • aStoredProcedureName: stored procedure's name
  • Params: stored procedure params.

GetTableFields  protected safecall

Returns the fields of a specified table via calling of DoGetTableFields.

procedure GetTableFields(const aTableName: string; out Fields: TDAFieldCollection)

Parameters:

  • aTableName: Specified data table name
  • Fields: Output collection of data table fields

GetTableNames  protected safecall

Returns the list of tables names via calling of DoGetTableNames.

procedure GetTableNames(out List: IROStrings)

Parameters:

  • List: list of tables names.

GetViewFields  protected safecall

Returns the fields of a specified view via calling of DoGetViewFields.

procedure GetViewFields(const aViewName: string; out Fields: TDAFieldCollection)

Parameters:

  • aViewName: view's name
  • Fields: fields of a specified view.

GetViewNames  protected safecall

Returns the list of view names via calling of DoGetViewNames.

procedure GetViewNames(out List: IROStrings)

Parameters:

  • List: list of view names.

GetWhereBuilder  protected virtual safecall

Creates an instance of the TDASQL92WhereBuilder.

function GetWhereBuilder: TDASQLWhereBuilder

IdentifierIsQuoted  protected virtual safecall

Returns True if the iIdentifier is quoted.

function IdentifierIsQuoted(const iIdentifier: string): boolean

Parameters:

  • iIdentifier: identifier.

IdentifierNeedsQuoting  protected virtual safecall

Returns True if the iIdentifier should be quoted.

function IdentifierNeedsQuoting(const iIdentifier: string): boolean

Parameters:

  • iIdentifier: identifier.

InTransaction  protected

Returns the transaction state

property InTransaction: boolean read write

isAlive  protected virtual safecall

Returns True if connection is alive.

function isAlive: Boolean

MacroProcessor

Returns the correspondent TDASQLMacroProcessor.

property MacroProcessor: TDASQLMacroProcessor read write

Name  protected

Returns a human-readable name for the connection.

property Name: string read write

NewCommand  protected virtual safecall

Creates an IDASQLCommand based on CommandType.

function NewCommand(const Text: string; CommandType: TDASQLStatementType; const aCommandName: string): IDASQLCommand

Parameters:

  • Text: stored procedure's name or SQL statement (depends on command type)
  • CommandType: command type
  • aCommandName: command name

NewDataset  protected virtual safecall

Returns a new IDADataset implementation that can be used to retrieve records from the database.

function NewDataset(const SQL: string; const aDatasetName: string): IDADataset

Parameters:

  • SQL: SQL statement
  • aDatasetName: Dataset's name

OnAfterExecuteCommand

Fires right after a command was executed.

property OnAfterExecuteCommand: TDAAfterExecuteCommandEvent read write
delegate: procedure OnAfterExecuteCommand(const Sender: IDASQLCommand; ActualSQL: string; ElapsedMilliseconds: Cardinal)

OnAfterOpenDataset

Fires after dataset was opened

property OnAfterOpenDataset: TDAAfterOpenDatasetEvent read write
delegate: procedure OnAfterOpenDataset(const Sender: IDADataset; ActualSQL: string; ElapsedMilliseconds: Cardinal)

OnBeforeExecuteCommand

Fires just before a command will be executed.

property OnBeforeExecuteCommand: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecuteCommand(const Sender: IDASQLCommand)

OnBeforeOpenDataset

Fires before dataset was opened

property OnBeforeOpenDataset: TDABeforeOpenDatasetEvent read write
delegate: procedure OnBeforeOpenDataset(const Sender: IDADataset)

OnExecuteCommandError

Fires when exception is detected during command execution

property OnExecuteCommandError: TDAExecuteCommandErrorEvent read write
delegate: procedure OnExecuteCommandError(const Sender: IDASQLCommand; ActualSQL: string; Error: Exception)

OnOpenDatasetError

Fired if error was occured duting opening of dataset

property OnOpenDatasetError: TDAOpenDatasetErrorEvent read write
delegate: procedure OnOpenDatasetError(const Sender: IDADataset; ActualSQL: string; Error: Exception)

Open  protected safecall

Sets UserID and Password if they are present and opens a physical connection to the database back-end,

procedure Open(const aUserID: string; const aPassword: string)

Parameters:

  • aUserID: username
  • aPassword: password

Password  protected

Password

property Password: string read write

QuoteFieldName  protected virtual safecall

Quotes field name.

function QuoteFieldName(const aTableName: string; const aFieldName: string): string

Parameters:

  • aTableName: table name.
  • aFieldName: field name.

QuoteFieldNameIfNeeded  protected virtual safecall

Quotes field name if is required.

function QuoteFieldNameIfNeeded(const aTableName: string; const aFieldName: string): string

Parameters:

  • aTableName: table name.
  • aFieldName: field name.

QuoteIdentifier  protected virtual safecall

Quotes identifier.

function QuoteIdentifier(const iIdentifier: string): string

Parameters:

  • iIdentifier: identifier.

QuoteIdentifierIfNeeded  protected virtual safecall

Quotes identifier if is required.

function QuoteIdentifierIfNeeded(const iIdentifier: string): string

Parameters:

  • iIdentifier: identifier.

RollbackTransaction  protected safecall

Discards a transaction that was started with a prior call to BeginTransaction, via calling of DoRollbackTransaction. All changes made in the context of the transaction will be be discarded and not applied to the physical database. To persist the changes made, instead of discarding them, call CommitTransaction instead.

procedure RollbackTransaction

Test  protected virtual safecall

Tests connections.

procedure Test

UseMacroProcessor  protected

Specifies an usage of macro processor.

property UseMacroProcessor: Boolean read write

UserID  protected

UserID

property UserID: string read write

 

Connected  protected

Indicates whether the connection object currently has an active link to the database (true) or not (false). Usually, a Data Abstract connection connects to the database when it is created, and is not closed until discarded and eventually removed from the connection pool.

property Connected: boolean read write

ConnectionDefinition  protected

Holds a reference to the TDAConnection

property ConnectionDefinition: TDAConnection read write

ConnectionManager  protected

Holds a reference to the IDAConnectionManager.

property ConnectionManager: IDAConnectionManager read write

ConnectionName  protected

Holds the connection name.

property ConnectionName: string read write

ConnectionObject  protected

Provides access to the internal connection component and facilitates access to its properties in form of a collection of properties.

property ConnectionObject: TCustomConnection read write

ConnectionPool

Provides access to the IDAConnectionPool.

property ConnectionPool: IDAConnectionPool read write

ConnectionProperties  protected

Returns value of given property

property ConnectionProperties[aPropertyName: string]: Variant read write

ConnectionString  protected

Sets the database connection string that was used to open this connection. The exact content of this string depends on the driver and database you are using, but it will usually contain information such as the database name, user id and password, as well as additional connection parameters. Please refer to the reference for the specific driver for more details.

property ConnectionString: string read write

ConnectionType  protected

Holds the connection type.

property ConnectionType: string read write

Driver

Reference to the owner TDAEDriver.

property Driver: TDAEDriver read write

InTransaction  protected

Returns the transaction state

property InTransaction: boolean read write

MacroProcessor

Returns the correspondent TDASQLMacroProcessor.

property MacroProcessor: TDASQLMacroProcessor read write

Name  protected

Returns a human-readable name for the connection.

property Name: string read write

Password  protected

Password

property Password: string read write

UseMacroProcessor  protected

Specifies an usage of macro processor.

property UseMacroProcessor: Boolean read write

UserID  protected

UserID

property UserID: string read write

 

constructor Create  virtual

Creates a new instance.

constructor Create(aDriver: TDAEDriver; aName: string)

Parameters:

  • aDriver: owner driver.
  • aName: name of connection.

ApplyConnectionString  protected

Parses connection string.

procedure ApplyConnectionString(const aConnectionString: string; aConnectionObject: TCustomConnection)

Parameters:

  • aConnectionString: Connection string
  • aConnectionObject: Connection

AssignCommandEventHandlers  protected

Assigns OnBeforeExecute, OnAfterExecute and OnExecuteError events to correspondent events of aCommand

procedure AssignCommandEventHandlers(const aCommand: IDASQLCommand)

Parameters:

  • aCommand: Command

AssignDatasetEventHandlers  protected

Assigns OnBeforeOpen, OnAfterOpen and OnExecuteOpen events to correspondent events of aDataset

procedure AssignDatasetEventHandlers(const aDataset: IDADataset)

Parameters:

  • aDataset: Dataset

BeginTransaction  protected safecall

Starts transaction via calling of DoBeginTransaction.

function BeginTransaction: integer

Close  protected safecall

Closes a physical connection to the database back-end,

procedure Close

CommitTransaction  protected safecall

Commits transaction via calling of DoCommitTransaction.

procedure CommitTransaction

CreateCustomConnection  protected virtual abstract

Creates standard TCustomConnection

function CreateCustomConnection: TCustomConnection

CreateMacroProcessor  protected virtual

Creates a macro processor.

function CreateMacroProcessor: TDASQLMacroProcessor

DoBeginTransaction  protected virtual abstract

Starts transaction.

function DoBeginTransaction: integer

DoCommitTransaction  protected virtual abstract

Commits transaction.

procedure DoCommitTransaction

DoGetForeignKeys  protected virtual safecall

Fills ForeignKeys with actual foreign keys.

procedure DoGetForeignKeys(out ForeignKeys: TDADriverForeignKeyCollection)

Parameters:

  • ForeignKeys: collection that will be filled.

DoGetInTransaction  protected virtual abstract

Returns the transaction state.

function DoGetInTransaction: boolean

DoGetLastAutoInc  protected virtual

Returns last auto increment value.

function DoGetLastAutoInc(const GeneratorName: string): integer

Parameters:

  • GeneratorName: Specified generator name.

DoGetLastAutoIncValue  protected virtual

Returns last auto increment value.

function DoGetLastAutoIncValue(const GeneratorName: string): Variant

Parameters:

  • GeneratorName: Specified generator name.

DoGetQueryFields  protected virtual safecall

Returns the fields of a specified SQL.

procedure DoGetQueryFields(const aSQL: string; aParamsIfNeeded: TDAParamCollection; out Fields: TDAFieldCollection)

Parameters:

  • aSQL: given SQL
  • aParamsIfNeeded: optional parameters
  • Fields: fields of SQL

DoGetStoredProcedureNames  protected virtual safecall

Returns the list of stored procedures names.

procedure DoGetStoredProcedureNames(out List: IROStrings)

Parameters:

  • List: Output list with names of stored procedures

DoGetStoredProcedureParams  protected virtual safecall

Retrieves the stored procedure params.

procedure DoGetStoredProcedureParams(const aStoredProcedureName: string; out Params: TDAParamCollection)

Parameters:

  • aStoredProcedureName: Stored procedure name
  • Params: Output collection of parameters

DoGetTableFields  protected virtual safecall

Returns the fields of a specified table.

procedure DoGetTableFields(const aTableName: string; out Fields: TDAFieldCollection)

Parameters:

  • aTableName: Specified data table name
  • Fields: Output collection of data table fields

DoGetTableNames  protected virtual safecall

Returns the list of tables names.

procedure DoGetTableNames(out List: IROStrings)

Parameters:

  • List: Output list of data table names

DoGetViewFields  protected virtual safecall

Returns the fields of a specified view.

procedure DoGetViewFields(const aViewName: string; out Fields: TDAFieldCollection)

Parameters:

  • aViewName: Specified view name
  • Fields: Output collection of data table fields

DoGetViewNames  protected virtual safecall

Returns the list of view names.

procedure DoGetViewNames(out List: IROStrings)

Parameters:

  • List: Output list of views

DoRollbackTransaction  protected virtual abstract

Rollbacks the transaction.

procedure DoRollbackTransaction

GetConnected  protected virtual safecall

Returns connection state.

function GetConnected: boolean

GetDatasetClass  protected virtual

Returns the actual TDAEDatasetClass descendant.

function GetDatasetClass: TDAEDatasetClass

GetForeignKeys  protected safecall

Fills ForeignKeys with actual foreign keys via calling of DoGetForeignKeys.

procedure GetForeignKeys(out ForeignKeys: TDADriverForeignKeyCollection)

Parameters:

  • ForeignKeys: collection that will be filled.

GetInTransaction  protected safecall

Returns the transaction state via calling of DoGetInTransaction.

function GetInTransaction: boolean

GetLastAutoInc  protected safecall

Returns last auto increment value as integer value via calling of DoGetLastAutoInc

function GetLastAutoInc(const GeneratorName: string): integer

Parameters:

  • GeneratorName: Specified generator name.

GetLastAutoIncValue  protected safecall

Returns last auto increment value as variant value via calling of DoGetLastAutoIncValue

function GetLastAutoIncValue(const GeneratorName: string): variant

Parameters:

  • GeneratorName: Specified generator name.

GetName  protected safecall

Return the connection name.

function GetName: string

GetQueryBuilder  protected virtual safecall

Creates an instance of the TDAQueryBuilder.

function GetQueryBuilder: TDAQueryBuilder

GetQueryFields  protected safecall

Returns the fields of a specified SQL via calling of DoGetQueryFields

procedure GetQueryFields(const aSQL: string; aParamsIfNeeded: TDAParamCollection; out Fields: TDAFieldCollection)

Parameters:

  • aSQL: given SQL
  • aParamsIfNeeded: optional parameters
  • Fields: fields of SQL

GetQuoteChars  protected virtual safecall

Returns quote symbols as an array.

function GetQuoteChars: TDAQuoteCharArray

GetSPSelectSyntax  protected virtual safecall

Returns the syntax of a stored procedure for usage in a select query.

function GetSPSelectSyntax(HasArguments: Boolean): string

Parameters:

  • HasArguments: parameters are present or not

GetStoredProcedureClass  protected virtual

Returns the actual TDAEStoredProcedure descendant.

function GetStoredProcedureClass: TDAEStoredProcedureClass

GetStoredProcedureNames  protected safecall

Returns the list of stored procedures names via calling of DoGetStoredProcedureNames.

procedure GetStoredProcedureNames(out List: IROStrings)

Parameters:

  • List: list of stored procedures names

GetStoredProcedureParams  protected safecall

Retrieves the stored procedure params.

procedure GetStoredProcedureParams(const aStoredProcedureName: string; out Params: TDAParamCollection)

Parameters:

  • aStoredProcedureName: stored procedure's name
  • Params: stored procedure params.

GetTableFields  protected safecall

Returns the fields of a specified table via calling of DoGetTableFields.

procedure GetTableFields(const aTableName: string; out Fields: TDAFieldCollection)

Parameters:

  • aTableName: Specified data table name
  • Fields: Output collection of data table fields

GetTableNames  protected safecall

Returns the list of tables names via calling of DoGetTableNames.

procedure GetTableNames(out List: IROStrings)

Parameters:

  • List: list of tables names.

GetViewFields  protected safecall

Returns the fields of a specified view via calling of DoGetViewFields.

procedure GetViewFields(const aViewName: string; out Fields: TDAFieldCollection)

Parameters:

  • aViewName: view's name
  • Fields: fields of a specified view.

GetViewNames  protected safecall

Returns the list of view names via calling of DoGetViewNames.

procedure GetViewNames(out List: IROStrings)

Parameters:

  • List: list of view names.

GetWhereBuilder  protected virtual safecall

Creates an instance of the TDASQL92WhereBuilder.

function GetWhereBuilder: TDASQLWhereBuilder

IdentifierIsQuoted  protected virtual safecall

Returns True if the iIdentifier is quoted.

function IdentifierIsQuoted(const iIdentifier: string): boolean

Parameters:

  • iIdentifier: identifier.

IdentifierNeedsQuoting  protected virtual safecall

Returns True if the iIdentifier should be quoted.

function IdentifierNeedsQuoting(const iIdentifier: string): boolean

Parameters:

  • iIdentifier: identifier.

isAlive  protected virtual safecall

Returns True if connection is alive.

function isAlive: Boolean

NewCommand  protected virtual safecall

Creates an IDASQLCommand based on CommandType.

function NewCommand(const Text: string; CommandType: TDASQLStatementType; const aCommandName: string): IDASQLCommand

Parameters:

  • Text: stored procedure's name or SQL statement (depends on command type)
  • CommandType: command type
  • aCommandName: command name

NewDataset  protected virtual safecall

Returns a new IDADataset implementation that can be used to retrieve records from the database.

function NewDataset(const SQL: string; const aDatasetName: string): IDADataset

Parameters:

  • SQL: SQL statement
  • aDatasetName: Dataset's name

Open  protected safecall

Sets UserID and Password if they are present and opens a physical connection to the database back-end,

procedure Open(const aUserID: string; const aPassword: string)

Parameters:

  • aUserID: username
  • aPassword: password

QuoteFieldName  protected virtual safecall

Quotes field name.

function QuoteFieldName(const aTableName: string; const aFieldName: string): string

Parameters:

  • aTableName: table name.
  • aFieldName: field name.

QuoteFieldNameIfNeeded  protected virtual safecall

Quotes field name if is required.

function QuoteFieldNameIfNeeded(const aTableName: string; const aFieldName: string): string

Parameters:

  • aTableName: table name.
  • aFieldName: field name.

QuoteIdentifier  protected virtual safecall

Quotes identifier.

function QuoteIdentifier(const iIdentifier: string): string

Parameters:

  • iIdentifier: identifier.

QuoteIdentifierIfNeeded  protected virtual safecall

Quotes identifier if is required.

function QuoteIdentifierIfNeeded(const iIdentifier: string): string

Parameters:

  • iIdentifier: identifier.

RollbackTransaction  protected safecall

Discards a transaction that was started with a prior call to BeginTransaction, via calling of DoRollbackTransaction. All changes made in the context of the transaction will be be discarded and not applied to the physical database. To persist the changes made, instead of discarding them, call CommitTransaction instead.

procedure RollbackTransaction

Test  protected virtual safecall

Tests connections.

procedure Test

 

OnAfterExecuteCommand

Fires right after a command was executed.

property OnAfterExecuteCommand: TDAAfterExecuteCommandEvent read write
delegate: procedure OnAfterExecuteCommand(const Sender: IDASQLCommand; ActualSQL: string; ElapsedMilliseconds: Cardinal)

OnAfterOpenDataset

Fires after dataset was opened

property OnAfterOpenDataset: TDAAfterOpenDatasetEvent read write
delegate: procedure OnAfterOpenDataset(const Sender: IDADataset; ActualSQL: string; ElapsedMilliseconds: Cardinal)

OnBeforeExecuteCommand

Fires just before a command will be executed.

property OnBeforeExecuteCommand: TDABeforeExecuteCommandEvent read write
delegate: procedure OnBeforeExecuteCommand(const Sender: IDASQLCommand)

OnBeforeOpenDataset

Fires before dataset was opened

property OnBeforeOpenDataset: TDABeforeOpenDatasetEvent read write
delegate: procedure OnBeforeOpenDataset(const Sender: IDADataset)

OnExecuteCommandError

Fires when exception is detected during command execution

property OnExecuteCommandError: TDAExecuteCommandErrorEvent read write
delegate: procedure OnExecuteCommandError(const Sender: IDASQLCommand; ActualSQL: string; Error: Exception)

OnOpenDatasetError

Fired if error was occured duting opening of dataset

property OnOpenDatasetError: TDAOpenDatasetErrorEvent read write
delegate: procedure OnOpenDatasetError(const Sender: IDADataset; ActualSQL: string; Error: Exception)

Descendants

See Also