DAC for MySQL

TMySQLDataSet.Properties.Database

Previous Next

Specifies the TmySQLDatabase component this component connects to to perform database operations.

Syntax:

property Database: TMySQLDatabase;

Description:

Use Database property to access the connection and some other properties, events, and methods of the database component associated with this dataset.

In design-time you may choose database from drop-down list for given MySQLTable or MySQLQuery.

Example:

// Do a transaction
with MySQLTable1.Database do
begin
  StartTransAction; 
  // transactions supporting depends on table's type.
  // MyISAM tables (default type in MySQL) don't 
  // support transactions, InnoDB and BDB tables do.
  // Post some records with MySQLTable1
  Commit; 
end;