ZEOS Database Objects MySQL Components |
Component for connections to the MySQL database server. The dynamic load library libmysql.dll is necessary.
Hierarchy: TObject->TPersistent->TComponent->TZDatabase->TZMySQLDatabase
TZMySQLDatabase properties | |
Handle:TDirConnect | Descriptor of direct connection to the database |
Host:ShortString | MySQL database server host name |
Database:ShortString | Database name |
Login:ShortString | User name for connection |
Password:ShortString | Password for connection to the database |
LoginPromt:Boolean | When the value is switched to true, window for entering user name and password appears. |
Port:ShortString | Port number for connection to MySQL server |
Connected:Boolean | Indicates the connection to database. When the value is switched to true, connection to the database occurs. Method Connect does the same. |
Encoding:TEncodingType | Indicates the local code page of symbols for representing contents of the database content.
The following table lists all possible values:
|
TZMySQLDatabase methods | |
procedure Connect() | Connects to the database |
procedure Disconnect() | Disconnects from the database |
TZMySQLDatabase events | |
procedure AfterConnect(Sender:TObject) | Occurs after an application completes connecting to a database |
procedure AfterDisconnect(Sender:TObject) | Occurs after an application completes disconnecting from a database |
procedure BeforeConnect(Sender:TObject) | Occurs before an application completes connecting to a database |
procedure BeforeDisconnect(Sender:TObject) | Occurs before an application completes disconnecting from a database |
Component for the tracing of an outgoing queries. It have the one event, which occurs when any SQL queries is processed by MySQL server. It returns the outgoing query and its result.
Hierarchy: TObject->TPersistent->TComponent->TZMonitor->TZMySQLMonitor
TZMySQLMonitor events | |
procedure MonitorEvent(Sql, Result: String) | Event occurs when MySQL server have processed the query.
The returning values:
|
Component for perfoming SQL queries to MySQL server. It's used for sending SQL statements to MySQL server. пересылки выражений SQL запросов MySQL серверу. The results of processing is available to use with the standart TDataSource. The records can be added, deleted or changed.
Hierarchy: TObject->TPersistenet->TComponent->TDataSet->TZDataSet-> TZCustomMySQLDataSet->TZMySQLQuery
TZMySQLQuery properties | |
Active:Boolean | Indicates the query is opened. When the value is switched to true, query will be opened. For query like 'SELECT' only. |
AutoCalcFields:Boolean | Determines when the OnCalcFields event is triggered. |
CachedUpdates:Boolean | Specifies whether cached updates are enabled |
DataBase:TZMySQLDatabase | Identifies the database component |
DataSource:TDataSource | Identifies DataSource for access |
ExtraOptions:TMySQLOptions | The set of the special options:
|
Filter:ShortString | Specifies the text of the current filter for a dataset. |
Filtered:Boolean | Specifies whether filtering is active for a dataset. |
FilterOptions:TFilterOptions | Specifies filters is:
|
LinkFields | The Wizard of relationships of queries |
LinkOptions:TZLinkOptions | The set of options for linking fileds
|
MasterSource:TDataSource | Indicates the master DataSource for linking of fields |
Options:TZDatabaseOptions | Extended options
|
ParamCount:Word | Indicates the current number of parameters for the query. |
Params:TParams | Contains the parameters for a query's SQL statement. |
ParamCheck:Boolean | Specifies whether the parameter list for a query is regenerated |
RequestLive:Boolean | Specifies whether or not a query result is read-only |
RecordCount:LongInt | Indicates the total number of records associated with the dataset. |
ShowRecordTypes | The parameters of records, which determines to show:
|
Sql:TStringList | Contains the text of the SQL statement to execute for the query |
Transaction:TZMySQLTransact | Indicates Transact component |
UpdateObject:TZUpdateSQL | Specifies the update object component used to update a read-only result set when cached updates are enabled. |
TZMySQLQuery methods | |
procedure ExecSql; | Executes the SQL statement for the query. Use ExecSQL to execute queries that do not return a cursor to data (such as INSERT, UPDATE, DELETE, and CREATE TABLE). |
function RowsAffected: LongInt; | Returns the number of rows operated upon by the latest query execution. |
procedure SortInverse; | Inverts rules for sorting of the records |
procedure SortClear; | Removes rules for sorting of the records |
procedure SortByField(FieldName: string); | Sorts all record by field |
procedure SortDescByField(FieldName: string); | Sorts all record by field descanding |
function Locate(const KeyFields: string; const KeyValues: Variant; Options: TLocateOptions): Boolean; | Searches the dataset for a specified record and makes that record the current record.
Options is a set that optionally specifies additional search latitude when searching on string fields.
|
function Lookup(const KeyFields: string; const KeyValues: Variant; const ResultFields: string): Variant; | Retrieves field values from a record that matches specified search values, like Locate. |
function IsSequenced: Boolean; | Indicates whether sequence numbers are available for database records. |
procedure ApplyUpdates; | Writes a dataset's pending cached updates to the database |
procedure CommitUpdates; | Clears the cached updates buffer. |
procedure CancelUpdates; | Clears all pending cached updates from the cache and restores the dataset its prior state. |
procedure RevertRecord; | Restores the current record in the dataset to an unmodified state when cached updates are enabled. |
function ParamByName(const Value: string): TParam; | Accesses parameter information based on a specified parameter name. |
function CreateBlobStream(Field: TField; Mode: TBlobStreamMode): TStream; | Provides the interface for a method that creates a blob stream for a Binary large object (BLOB) field in the dataset.
|
procedure SaveToStream(Stream: TStream); | Saves the contents of a Dataset to a stream. |
procedure LoadFromStream(Stream: TStream); | Loads a stream into the Dataset. |
procedure SaveToFile(FileName: string); | Saves a dataset's data to an external file. |
procedure LoadFromFile(FileName: string); | Loads a dataset's data from a file. |
TZMySQLQuery events | |
procedure AfterCancel(DataSet: TDataSet); | Occurs after an application completes a request to cancel modifications to the current record. |
procedure AfterClose(DataSet: TDataSet); | Occurs after an application closes a dataset. |
procedure AfterDelete(DataSet: TDataSet); | Occurs after an application deletes a record. |
procedure AfterEdit(DataSet: TDataSet); | Occurs after an application deletes a record. |
procedure AfterInsert(DataSet: TDataSet); | Occurs after an application inserts a new record. |
procedure AfterOpen(DataSet: TDataSet); | Occurs after an application completes opening a dataset and before any data access occurs. |
procedure AfterPost(DataSet: TDataSet); | Occurs after an application writes the current record to the database or cache and before the dataset is returned to browse state. |
procedure AfterScroll(DataSet: TDataSet); | Occurs after an application scrolls from one record to another. |
procedure BeforeCancel(DataSet: TDataSet); | Occurs before an application executes a request to cancel changes to the current record. |
procedure BeforeClose(DataSet: TDataSet); | Occurs before an application executes a request to close the dataset. |
procedure BeforeDelete(DataSet: TDataSet); | Occurs before an application attempts to delete the current record. |
procedure BeforeEdit(DataSet: TDataSet); | Occurs before an application enters edit mode for the current record. |
procedure BeforeInsert(DataSet: TDataSet); | Occurs before an application enters insert mode. |
procedure BeforeOpen(DataSet: TDataSet); | Occurs before an application executes a request to open a dataset. |
procedure BeforePost(DataSet: TDataSet); | Occurs before an application posts changes for the current record to the database or cache. |
procedure BeforeScroll(DataSet: TDataSet); | Occurs before an application scrolls from one record to another. |
procedure ApplyUpdateError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); | Occurs if an exception is generated when cached updates are applied to a database. |
procedure CalcFields(DataSet: TDataSet); | Occurs when an application recalculates calculated fields. |
procedure DeleteError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); | Occurs when an application attempts to delete a record and an exception is raised. |
procedure EditError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); | Occurs when an application attempts to modify or insert a record and an exception is raised. |
procedure FilterRecord(DataSet: TDataSet;var Accept: Boolean); | Occurs each time a different record in the dataset becomes the current record and filtering is enabled. |
procedure NewRecord(DataSet: TDataSet); | Occurs when an application inserts or appends a new dataset record. |
procedure PostError(DataSet: TDataSet; E: EDatabaseError; var Action: TDataAction); | Occurs when an application attempts to modify or insert a record and an exception is raised. |
procedure UpdateRecord(DataSet: TDataSet; UpdateKind: TUpdateKind; var UpdateAction: TUpdateAction); | Occurs if an exception is generated when cached updates are applied to a database. |
Component for processing the results of the query to MySQL server in the manner of table.
Hierarchy: TObject->TPersistenet->TComponent->TDataSet->TZDataSet-> TZCustomMySQLDataSet->TZMySQLTable
Hasn't any principle differences from TZMySQLQuery, but the following exclusions:
Component for work with transactions of MySQL server
Hierarchy: TObject->TPersistent->TComponent->TZTransact->TZMySQLTransact
TZMySQLTransact properties | |
AutoCommit:Boolean | If of the value of this property is switched to true then updates will be apllied automatically. Otherwise is necessary to call Commit or Rollback manually. |
Connected:Boolean | Indicates the connection to a database |
Database:TZMySQLDatabase | Specifies a database component |
Options:TZTransactOptions | The set of options:
|
TZMySQLTransact methods | |
procedure Connect | Connects to MySQL server |
procedure Disconnect | Disconnects from MySQL server |
procedure Commit | Updates all changes in the transaction buffer and its clear |
procedure RollBack | Rollback of transactions |
procedure DoApplyUpdates | Updates all changes from the transaction buffer |
TZMySQLTransact events | |
procedure OnApplyUpdates(Sender:TObject) | Occurs when an application applies all changes from the transaction buffer |
procedure OnCommit(Sender:TObject) | Occurs when an application calls Commit method |
procedure OnDataChange(Sender:TObject) | Occurs when contents of the database is changed |
procedure OnRollBack(Sender:TObject) | Occurs when an apllication calls Rollback method |