Sign in Join
Wiki copytemporary

TSQLQuery/fr: what changed

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

Title: TSQLQuery/fr

OldNewLine
1+**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]].
2+
3+Utilisation typique d'un TSQLQuery:
4+
5+` SQLTransaction1.Database := SQLConnection1;`\
6+` SQLQuery1.Transaction := SQLTransaction1;`\
7+` DataSource1.DataSet := `**`SQLQuery1`**`;`\
8+` DBGrid1.DataSource := DataSource1;`
9+
10+### Sélection
11+
12+Sélection des enregistrements de la table somelist :
13+
14+``` pascal
15+ SQLQuery1.SQL.Text := 'SELECT * FROM somelist';
16+ SQLTransaction1.Open();
17+```
18+
19+### Insertion
20+
21+Insertion d'un nouvel enregistrement dans la table somelist :
22+
23+``` pascal
24+ SQLQuery1.SQL.Text := 'INSERT INTO somelist (ItemNr,ItemCount) VALUES (1231,2)';
25+ SQLQuery1.ExecSQL();
26+ SQLTransaction1.Commit();
27+```
28+
29+## Voir aussi
30+
31+- [Doc TSQLQuery](http://www.freepascal.org/docs-html/fcl/sqldb/tsqlquery.html)
32+- [Utilisation de SQLdb](http://www.freepascal.org/docs-html/fcl/sqldb/usingsqldb.html)
33+
34+---
35+*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