Fetching the Data using TSQLDataSet

From RAD Studio
Jump to: navigation, search

Go Up to Using dbExpress


To fetch the data

  1. Open File > New > Windows VCL Application - Delphi
  2. From the dbExpress category of the Tool Palette, drag a TSQLDataSet component to the form.
  3. To fetch the data for a unidirectional dataset, do one of the following:
    • In the Object Inspector, set the Active property to True.
    • Call the Open method at run time.

      Tip: Use GetMetadata property to selectively fetch metadata on a database object. Set GetMetadata to False if you are fetching a dataset for read-only purposes.

  4. Set its Prepared property to True to prepare the dataset explicitly.
  5. Call the NextRecordSet method to fetch multiple sets of records.

Note: NextRecordSet returns a newly created TCustomSQLDataSet component that provides access to the next set of records. That is, the first time you call NextRecordSet, it returns a dataset for the second set of records. Calling NextRecordSet returns a third dataset, and so on, until there are no more sets of records. When there are no additional datasets, NextRecordSet does not return anything.

See Also