Sign in Join
Wiki copytemporary

TSQLQuery/fr: what changed

Revision 1 to 2. Removed lines have a minus sign; added lines have a plus sign.

OldNewLine
11**TSQLQuery** ![](/wiki-images/b/bb/Tsqlquery.png) 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 tab/fr|SQLdb]] de la [[Component Palette/fr|palette de coomposants]].
22
33Utilisation typique d'un TSQLQuery:
44
5-` SQLTransaction1.Database := SQLConnection1;`\
6-` SQLQuery1.Transaction := SQLTransaction1;`\
7-` DataSource1.DataSet := `**`SQLQuery1`**`;`\
8-` DBGrid1.DataSource := DataSource1;`
5+``` pascal
6+ SQLTransaction1.Database := SQLConnection1;
7+ SQLQuery1.Transaction := SQLTransaction1;
8+ DataSource1.DataSet := SQLQuery1;
9+ DBGrid1.DataSource := DataSource1;
10+```
911
1012### Sélection
1113
1214Sélection des enregistrements de la table somelist :
1315
1416``` pascal
1517 SQLQuery1.SQL.Text := 'SELECT * FROM somelist';
1618 SQLTransaction1.Open();
1719```
1820
1921### Insertion
2022
2123Insertion d'un nouvel enregistrement dans la table somelist :
2224
2325``` pascal
2426 SQLQuery1.SQL.Text := 'INSERT INTO somelist (ItemNr,ItemCount) VALUES (1231,2)';
2527 SQLQuery1.ExecSQL();
2628 SQLTransaction1.Commit();
2729```
2830
2931## Voir aussi
3032
3133- [Doc TSQLQuery](http://www.freepascal.org/docs-html/fcl/sqldb/tsqlquery.html)
3234- [Utilisation de SQLdb](http://www.freepascal.org/docs-html/fcl/sqldb/usingsqldb.html)
3335
3436---
3537*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](/wiki-contact).*

Back to history