Sign in Join
Wiki copytemporary

TSQLQuery/fr

English · Français · Русский · 日本語

TSQLQuery est composant fondamental de requête dans les bases de données pour l'utilisation de n'importe quel SGBDR pris en charge. Le composant se trouve sur l'onglet SQLdb de la palette de coomposants.

Utilisation typique d'un TSQLQuery:

pascal
 SQLTransaction1.Database := SQLConnection1;
 SQLQuery1.Transaction := SQLTransaction1;
 DataSource1.DataSet := SQLQuery1;
 DBGrid1.DataSource := DataSource1;

Sélection

Sélection des enregistrements de la table somelist :

pascal
 SQLQuery1.SQL.Text := 'SELECT * FROM somelist';
 SQLTransaction1.Open();

Insertion

Insertion d'un nouvel enregistrement dans la table somelist :

pascal
 SQLQuery1.SQL.Text := 'INSERT INTO somelist (ItemNr,ItemCount) VALUES (1231,2)';
 SQLQuery1.ExecSQL();
 SQLTransaction1.Commit();

Voir aussi


From the Free Pascal wiki, page "TSQLQuery/fr", as it stood on 2020-03-02 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.

Revision 2, last changed by WikiArchive .

Talk about this page

Nobody has opened a bench for this page yet. Sign in to open one.