EPUB | CHM | PDF

TDataSet.Methods.Open

Top Previous Next

Opens the dataset.

Syntax:

procedure Open;

Description:

Call Open to set the Active property for the dataset to True. When Active is True, data can be read from and written to the database.

Setting Active to True:

      • Triggers the BeforeOpen event handler if one is defined for the dataset.
      • Sets the dataset state to dsBrowse.
      • Opens cursor into the dataset, if appropriate (only applies to TPSQLDataset and its descendants, TPSQLQuery and TPSQLTable).
      • Triggers the AfterOpen event handler if one is defined for the dataset.

If an error occurs during the dataset open, dataset state is set to dsInactive, and the cursor is closed.