TDataSet.Open¶
Activate the dataset: Fetch data into memory.
Declaration¶
Source position: db.pas line 2085
public
procedure TDataSet.Open;
Description¶
Open must be used to make the TDataset Active. It does nothing if the dataset is already active. Open initializes the TDataset and brings the dataset in a browsable state:
Effectively the following happens:
- The BeforeOpen event is triggered.
- The descendents InternalOpen method is called to actually fetch data and initialize fielddefs and field instances.
- BOFis set to True
- Internal buffers are allocated and filled with data
- If the dataset is empty, EOF is set to true
- State is set to dsBrowse
- The AfterOpen event is triggered
Errors¶
If the descendent class cannot fetch the data, or the data does not match the field definitions present in the dataset, then an exception will be raised.
See also¶
| Name | Description |
|---|---|
| TDataset.Active | Is the dataset open or closed. |
| TDataset.State | Current operational state of the dataset. |
| TDataset.BOF | Is the cursor at the beginning of the data (on the first record). |
| TDataset.EOF | Indicates whether the last record has been reached. |
| TDataset.BeforeOpen | Event triggered before the dataset is opened. |
| TDataset.AfterOpen | Event triggered after the dataset is opened. |