Fetching the Data using TSQLDataSet

From RAD Studio
Jump to: navigation, search

Go Up to Using dbExpress

To fetch the data

  1. Choose File > New > Other. The New Items dialog appears.
  2. In the New Items dialog, select Delphi Projects and double-click VCL Forms Application. The Windows Designer displays.
  3. From the dbExpress category of the Tool Palette, drag a TSQLDataSet component to the form.
  4. 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.

  5. Set its Prepared property to True to prepare the dataset explicitly.
  6. 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