Difference between revisions of "TDataSet"
From Free Pascal wiki
Jump to navigationJump to searchLine 1: | Line 1: | ||
'''TDataSet''' is the main link to the actual data in a database. A TDataSet descendant acts like a cursor on a table or query-result. | '''TDataSet''' is the main link to the actual data in a database. A TDataSet descendant acts like a cursor on a table or query-result. | ||
+ | <syntaxhighlight> | ||
SQLTransaction1.Database := SQLConnection1; | SQLTransaction1.Database := SQLConnection1; | ||
SQLQuery1.Transaction := SQLTransaction1; | SQLQuery1.Transaction := SQLTransaction1; | ||
DataSource1.'''DataSet''' := SQLQuery1; | DataSource1.'''DataSet''' := SQLQuery1; | ||
DBGrid1.DataSource := DataSource1; | DBGrid1.DataSource := DataSource1; | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | A dataset (for example a query restult) can be edited: | ||
+ | <syntaxhighlight> | ||
+ | ds.Edit(); | ||
+ | ds.FieldByName('NAME').AsString := 'Edited name'; | ||
+ | dd.Post(); | ||
+ | ds.UpdateMode := upWhereAll; | ||
+ | ds.ApplyUpdates(); | ||
+ | </syntaxhighlight> | ||
== non-abstract descendants == | == non-abstract descendants == |
Revision as of 14:45, 19 October 2016
TDataSet is the main link to the actual data in a database. A TDataSet descendant acts like a cursor on a table or query-result.
SQLTransaction1.Database := SQLConnection1;
SQLQuery1.Transaction := SQLTransaction1;
DataSource1.'''DataSet''' := SQLQuery1;
DBGrid1.DataSource := DataSource1;
A dataset (for example a query restult) can be edited:
ds.Edit();
ds.FieldByName('NAME').AsString := 'Edited name';
dd.Post();
ds.UpdateMode := upWhereAll;
ds.ApplyUpdates();
non-abstract descendants
- TBufDataset -
- TMemDataset -
- TSdfDataSet -
- TFixedFormatDataSet
- TDbf - connect to dBase
- TParadox - connect to Paradox/BDE
- TParadoxDataSet - connect to Paradox/BDE
- TFPCodeGenerator
- TSQLQuery - connect to results of a SQL-query
See also