| データベースのポータル |
|
参照: チュートリアル/練習となる記事: 各種データベース Advantage - MySQL - MSSQL - Postgres - Interbase - Firebird - Oracle - ODBC - Paradox - SQLite - dBASE - MS Access - Zeos |
TSQLQuery
is a fundamental database query component for use with any supported database. The component is found on SQLdb tab of the Component Palette.
Typical use of a TSQLQuery:
SQLTransaction1.Database := SQLConnection1;
SQLQuery1.Transaction := SQLTransaction1;
DataSource1.DataSet := SQLQuery1;
DBGrid1.DataSource := DataSource1;
Select
Select all columns from table somelist:
SQLQuery1.SQL.Text := 'SELECT * FROM somelist';
SQLQuery1.Open();
Insert
Insert a new record into table somelist:
SQLQuery1.SQL.Text := 'INSERT INTO somelist (ItemNr,ItemCount) VALUES (1231,2)';
SQLQuery1.ExecSQL();
SQLTransaction1.Commit();