TDAMySQLBaseConnection

Overview

TDAMySQLBaseConnection implements common functionality for connections to MySQL. Currently, the TDAEMyDACConnection and TDAEMySQLDacConnection descendant classes provide connections via MyDAC and connections via MySQLDAC, respectively.

Location

Implements

 

constructor Create  override

Creates a new instance.

constructor Create(aDriver: TDAEDriver; aName: string)

Parameters:

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

ApplyConnectionString  protected    (declared in TDAEConnection)

Parses connection string.

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

Parameters:

  • aConnectionString: Connection string
  • aConnectionObject: Connection

AssignCommandEventHandlers  protected    (declared in TDAEConnection)

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

procedure AssignCommandEventHandlers(const aCommand: IDASQLCommand)

Parameters:

  • aCommand: Command

AssignDatasetEventHandlers  protected    (declared in TDAEConnection)

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

procedure AssignDatasetEventHandlers(const aDataset: IDADataset)

Parameters:

  • aDataset: Dataset

BeginTransaction  protected safecall    (declared in TDAEConnection)

Starts transaction via calling of DoBeginTransaction.

function BeginTransaction: integer

Close  protected safecall    (declared in TDAEConnection)

Closes a physical connection to the database back-end,

procedure Close

CommitTransaction  protected safecall    (declared in TDAEConnection)

Commits transaction via calling of DoCommitTransaction.

procedure CommitTransaction

Connected  protected    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Holds a reference to the TDAConnection

property ConnectionDefinition: TDAConnection read write

ConnectionManager  protected    (declared in TDAEConnection)

Holds a reference to the IDAConnectionManager.

property ConnectionManager: IDAConnectionManager read write

ConnectionName  protected    (declared in TDAEConnection)

Holds the connection name.

property ConnectionName: string read write

ConnectionObject  protected    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Provides access to the IDAConnectionPool.

property ConnectionPool: IDAConnectionPool read write

ConnectionProperties  protected    (declared in TDAEConnection)

Returns value of given property

property ConnectionProperties[aPropertyName: string]: Variant read write

ConnectionString  protected    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Holds the connection type.

property ConnectionType: string read write

CreateCustomConnection  protected virtual abstract    (declared in TDAEConnection)

Creates standard TCustomConnection

function CreateCustomConnection: TCustomConnection

CreateMacroProcessor  protected override

function CreateMacroProcessor: TDASQLMacroProcessor

DoBeginTransaction  protected virtual abstract    (declared in TDAEConnection)

Starts transaction.

function DoBeginTransaction: integer

DoCommitTransaction  protected virtual abstract    (declared in TDAEConnection)

Commits transaction.

procedure DoCommitTransaction

DoGetForeignKeys  protected override

Fills ForeignKeys with actual foreign keys.

procedure DoGetForeignKeys(out ForeignKeys: TDADriverForeignKeyCollection)

Parameters:

  • ForeignKeys: collection that will be filled.

DoGetInTransaction  protected virtual abstract    (declared in TDAEConnection)

Returns the transaction state.

function DoGetInTransaction: boolean

DoGetLastAutoInc  protected override

Returns last auto increment value.

function DoGetLastAutoInc(const GeneratorName: string): integer

Parameters:

  • GeneratorName: Specified generator name.

DoGetLastAutoIncValue  protected override

Returns last auto increment value.

function DoGetLastAutoIncValue(const GeneratorName: string): Variant

Parameters:

  • GeneratorName: Specified generator name.

DoGetQueryFields  protected virtual safecall    (declared in TDAEConnection)

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 override

Returns the list of stored procedures names.

procedure DoGetStoredProcedureNames(out List: IROStrings)

Parameters:

  • List: Output list with names of stored procedures

DoGetStoredProcedureParams  protected override

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 override

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 override

Returns the list of tables names.

procedure DoGetTableNames(out List: IROStrings)

Parameters:

  • List: Output list of data table names

DoGetViewFields  protected virtual safecall    (declared in TDAEConnection)

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 override

Returns the list of view names.

procedure DoGetViewNames(out List: IROStrings)

Parameters:

  • List: Output list of views

DoRollbackTransaction  protected virtual abstract    (declared in TDAEConnection)

Rollbacks the transaction.

procedure DoRollbackTransaction

Driver    (declared in TDAEConnection)

Reference to the owner TDAEDriver.

property Driver: TDAEDriver read write

GetConnected  protected virtual safecall    (declared in TDAEConnection)

Returns connection state.

function GetConnected: boolean

GetDatabaseNames  protected

Returns the list of available databases.

function GetDatabaseNames: IROStrings

GetDatasetClass  protected virtual    (declared in TDAEConnection)

Returns the actual TDAEDatasetClass descendant.

function GetDatasetClass: TDAEDatasetClass

GetForeignKeys  protected safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Returns the transaction state via calling of DoGetInTransaction.

function GetInTransaction: boolean

GetLastAutoInc  protected safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Return the connection name.

function GetName: string

GetQueryBuilder  protected override

Creates an instance of the TDAQueryBuilder.

function GetQueryBuilder: TDAQueryBuilder

GetQueryFields  protected safecall    (declared in TDAEConnection)

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 override safecall

Returns quote symbols as an array.

function GetQuoteChars: TDAQuoteCharArray

GetSPSelectSyntax  protected virtual safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Returns the actual TDAEStoredProcedure descendant.

function GetStoredProcedureClass: TDAEStoredProcedureClass

GetStoredProcedureNames  protected safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

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    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Returns the list of tables names via calling of DoGetTableNames.

procedure GetTableNames(out List: IROStrings)

Parameters:

  • List: list of tables names.

GetTableSchema  protected virtual

Returns current table schema.

function GetTableSchema: string

GetViewFields  protected safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Creates an instance of the TDASQL92WhereBuilder.

function GetWhereBuilder: TDASQLWhereBuilder

IdentifierIsQuoted  protected virtual safecall    (declared in TDAEConnection)

Returns True if the iIdentifier is quoted.

function IdentifierIsQuoted(const iIdentifier: string): boolean

Parameters:

  • iIdentifier: identifier.

IdentifierNeedsQuoting  protected override safecall

Returns True if the iIdentifier should be quoted.

function IdentifierNeedsQuoting(const iIdentifier: string): boolean

Parameters:

  • iIdentifier: identifier.

InTransaction  protected    (declared in TDAEConnection)

Returns the transaction state

property InTransaction: boolean read write

isAlive  protected virtual safecall    (declared in TDAEConnection)

Returns True if connection is alive.

function isAlive: Boolean

MacroProcessor    (declared in TDAEConnection)

Returns the correspondent TDASQLMacroProcessor.

property MacroProcessor: TDASQLMacroProcessor read write

MySQLVersion

Returns version of the MySQL server.

property MySQLVersion: integer read write

Name  protected    (declared in TDAEConnection)

Returns a human-readable name for the connection.

property Name: string read write

NewCommand  protected virtual safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Fires right after a command was executed.

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

OnAfterOpenDataset    (declared in TDAEConnection)

Fires after dataset was opened

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

OnBeforeExecuteCommand    (declared in TDAEConnection)

Fires just before a command will be executed.

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

OnBeforeOpenDataset    (declared in TDAEConnection)

Fires before dataset was opened

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

OnExecuteCommandError    (declared in TDAEConnection)

Fires when exception is detected during command execution

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

OnOpenDatasetError    (declared in TDAEConnection)

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    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Password

property Password: string read write

QuoteFieldName  protected virtual safecall    (declared in TDAEConnection)

Quotes field name.

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

Parameters:

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

QuoteFieldNameIfNeeded  protected virtual safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Quotes identifier.

function QuoteIdentifier(const iIdentifier: string): string

Parameters:

  • iIdentifier: identifier.

QuoteIdentifierIfNeeded  protected virtual safecall    (declared in TDAEConnection)

Quotes identifier if is required.

function QuoteIdentifierIfNeeded(const iIdentifier: string): string

Parameters:

  • iIdentifier: identifier.

RollbackTransaction  protected safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Tests connections.

procedure Test

UseMacroProcessor  protected    (declared in TDAEConnection)

Specifies an usage of macro processor.

property UseMacroProcessor: Boolean read write

UserID  protected    (declared in TDAEConnection)

UserID

property UserID: string read write

useUnicode  protected virtual

Returns the status of unicode's support.

function useUnicode: Boolean

 

Connected  protected    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Holds a reference to the TDAConnection

property ConnectionDefinition: TDAConnection read write

ConnectionManager  protected    (declared in TDAEConnection)

Holds a reference to the IDAConnectionManager.

property ConnectionManager: IDAConnectionManager read write

ConnectionName  protected    (declared in TDAEConnection)

Holds the connection name.

property ConnectionName: string read write

ConnectionObject  protected    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Provides access to the IDAConnectionPool.

property ConnectionPool: IDAConnectionPool read write

ConnectionProperties  protected    (declared in TDAEConnection)

Returns value of given property

property ConnectionProperties[aPropertyName: string]: Variant read write

ConnectionString  protected    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Holds the connection type.

property ConnectionType: string read write

Driver    (declared in TDAEConnection)

Reference to the owner TDAEDriver.

property Driver: TDAEDriver read write

InTransaction  protected    (declared in TDAEConnection)

Returns the transaction state

property InTransaction: boolean read write

MacroProcessor    (declared in TDAEConnection)

Returns the correspondent TDASQLMacroProcessor.

property MacroProcessor: TDASQLMacroProcessor read write

MySQLVersion

Returns version of the MySQL server.

property MySQLVersion: integer read write

Name  protected    (declared in TDAEConnection)

Returns a human-readable name for the connection.

property Name: string read write

Password  protected    (declared in TDAEConnection)

Password

property Password: string read write

UseMacroProcessor  protected    (declared in TDAEConnection)

Specifies an usage of macro processor.

property UseMacroProcessor: Boolean read write

UserID  protected    (declared in TDAEConnection)

UserID

property UserID: string read write

 

constructor Create  override

Creates a new instance.

constructor Create(aDriver: TDAEDriver; aName: string)

Parameters:

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

ApplyConnectionString  protected    (declared in TDAEConnection)

Parses connection string.

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

Parameters:

  • aConnectionString: Connection string
  • aConnectionObject: Connection

AssignCommandEventHandlers  protected    (declared in TDAEConnection)

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

procedure AssignCommandEventHandlers(const aCommand: IDASQLCommand)

Parameters:

  • aCommand: Command

AssignDatasetEventHandlers  protected    (declared in TDAEConnection)

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

procedure AssignDatasetEventHandlers(const aDataset: IDADataset)

Parameters:

  • aDataset: Dataset

BeginTransaction  protected safecall    (declared in TDAEConnection)

Starts transaction via calling of DoBeginTransaction.

function BeginTransaction: integer

Close  protected safecall    (declared in TDAEConnection)

Closes a physical connection to the database back-end,

procedure Close

CommitTransaction  protected safecall    (declared in TDAEConnection)

Commits transaction via calling of DoCommitTransaction.

procedure CommitTransaction

CreateCustomConnection  protected virtual abstract    (declared in TDAEConnection)

Creates standard TCustomConnection

function CreateCustomConnection: TCustomConnection

CreateMacroProcessor  protected override

function CreateMacroProcessor: TDASQLMacroProcessor

DoBeginTransaction  protected virtual abstract    (declared in TDAEConnection)

Starts transaction.

function DoBeginTransaction: integer

DoCommitTransaction  protected virtual abstract    (declared in TDAEConnection)

Commits transaction.

procedure DoCommitTransaction

DoGetForeignKeys  protected override

Fills ForeignKeys with actual foreign keys.

procedure DoGetForeignKeys(out ForeignKeys: TDADriverForeignKeyCollection)

Parameters:

  • ForeignKeys: collection that will be filled.

DoGetInTransaction  protected virtual abstract    (declared in TDAEConnection)

Returns the transaction state.

function DoGetInTransaction: boolean

DoGetLastAutoInc  protected override

Returns last auto increment value.

function DoGetLastAutoInc(const GeneratorName: string): integer

Parameters:

  • GeneratorName: Specified generator name.

DoGetLastAutoIncValue  protected override

Returns last auto increment value.

function DoGetLastAutoIncValue(const GeneratorName: string): Variant

Parameters:

  • GeneratorName: Specified generator name.

DoGetQueryFields  protected virtual safecall    (declared in TDAEConnection)

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 override

Returns the list of stored procedures names.

procedure DoGetStoredProcedureNames(out List: IROStrings)

Parameters:

  • List: Output list with names of stored procedures

DoGetStoredProcedureParams  protected override

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 override

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 override

Returns the list of tables names.

procedure DoGetTableNames(out List: IROStrings)

Parameters:

  • List: Output list of data table names

DoGetViewFields  protected virtual safecall    (declared in TDAEConnection)

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 override

Returns the list of view names.

procedure DoGetViewNames(out List: IROStrings)

Parameters:

  • List: Output list of views

DoRollbackTransaction  protected virtual abstract    (declared in TDAEConnection)

Rollbacks the transaction.

procedure DoRollbackTransaction

GetConnected  protected virtual safecall    (declared in TDAEConnection)

Returns connection state.

function GetConnected: boolean

GetDatabaseNames  protected

Returns the list of available databases.

function GetDatabaseNames: IROStrings

GetDatasetClass  protected virtual    (declared in TDAEConnection)

Returns the actual TDAEDatasetClass descendant.

function GetDatasetClass: TDAEDatasetClass

GetForeignKeys  protected safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Returns the transaction state via calling of DoGetInTransaction.

function GetInTransaction: boolean

GetLastAutoInc  protected safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Return the connection name.

function GetName: string

GetQueryBuilder  protected override

Creates an instance of the TDAQueryBuilder.

function GetQueryBuilder: TDAQueryBuilder

GetQueryFields  protected safecall    (declared in TDAEConnection)

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 override safecall

Returns quote symbols as an array.

function GetQuoteChars: TDAQuoteCharArray

GetSPSelectSyntax  protected virtual safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Returns the actual TDAEStoredProcedure descendant.

function GetStoredProcedureClass: TDAEStoredProcedureClass

GetStoredProcedureNames  protected safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

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    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Returns the list of tables names via calling of DoGetTableNames.

procedure GetTableNames(out List: IROStrings)

Parameters:

  • List: list of tables names.

GetTableSchema  protected virtual

Returns current table schema.

function GetTableSchema: string

GetViewFields  protected safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Creates an instance of the TDASQL92WhereBuilder.

function GetWhereBuilder: TDASQLWhereBuilder

IdentifierIsQuoted  protected virtual safecall    (declared in TDAEConnection)

Returns True if the iIdentifier is quoted.

function IdentifierIsQuoted(const iIdentifier: string): boolean

Parameters:

  • iIdentifier: identifier.

IdentifierNeedsQuoting  protected override safecall

Returns True if the iIdentifier should be quoted.

function IdentifierNeedsQuoting(const iIdentifier: string): boolean

Parameters:

  • iIdentifier: identifier.

isAlive  protected virtual safecall    (declared in TDAEConnection)

Returns True if connection is alive.

function isAlive: Boolean

NewCommand  protected virtual safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

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    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Quotes field name.

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

Parameters:

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

QuoteFieldNameIfNeeded  protected virtual safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Quotes identifier.

function QuoteIdentifier(const iIdentifier: string): string

Parameters:

  • iIdentifier: identifier.

QuoteIdentifierIfNeeded  protected virtual safecall    (declared in TDAEConnection)

Quotes identifier if is required.

function QuoteIdentifierIfNeeded(const iIdentifier: string): string

Parameters:

  • iIdentifier: identifier.

RollbackTransaction  protected safecall    (declared in TDAEConnection)

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    (declared in TDAEConnection)

Tests connections.

procedure Test

useUnicode  protected virtual

Returns the status of unicode's support.

function useUnicode: Boolean

 

OnAfterExecuteCommand    (declared in TDAEConnection)

Fires right after a command was executed.

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

OnAfterOpenDataset    (declared in TDAEConnection)

Fires after dataset was opened

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

OnBeforeExecuteCommand    (declared in TDAEConnection)

Fires just before a command will be executed.

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

OnBeforeOpenDataset    (declared in TDAEConnection)

Fires before dataset was opened

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

OnExecuteCommandError    (declared in TDAEConnection)

Fires when exception is detected during command execution

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

OnOpenDatasetError    (declared in TDAEConnection)

Fired if error was occured duting opening of dataset

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

See Also

  • Data Abstract Connections (Delphi)
  • MySQL
  • Connect via MyDAC (Data Abstract)
  • Connect via MySQLDAC (Data Abstract)
  • TDAEConnection