EPUB | CHM | PDF

TMySQLDataSet.Properties.Database

Top 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.

note Since v2.7.1 DAC for MySQL tries to assign this property value to last added TMySQLDatabase component in design-time.

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, Falcon and BDB tables do.
  // Post some records with MySQLTable1
  Commit;
end;

See also: TMySQLDatabase component