Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I get data into a TClientDataset ?

dbExpress

How do I get data into a TClientDataset ?

by  towerbase  Posted    (Edited  )
TDatasetProvider provides the mechanism to get data into a TClientDataset.

TDatasetProvider is like a pipe connecting TClientDataset with TSQLDataset.

Typically if you want to show records from your database table on a TDBGrid in your application then you will need the following components.

TSQLConnection to provide the necessary connection details to the database. One TSQLConnection can service several TSQLDatasets.

A TSQLDataset component which will specify the TSQLConnection component in the SQLConnection property. The CommandText property of the TSQLDataset will have a suitable SQL statement such as
Code:
SELECT * FROM customer WHERE balance>100 ORDER BY balance
A TDatasetProvider component which will specify the TSQLDataset in its Dataset property.

A TClientDataset component which will specify the TDatasetProvider in its ProviderName property

A TDataSource component which will specify the TClientDataset component in its Dataset property.

A TDBGrid component which will specify the TDataSource in its DataSource property.

By setting the appropriate Active properties to true in TSQLConnection, TSQLDataset and TClientDataset you should find that the data will appear in the grid.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top