[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] | Reference for unit 'DB' (#fcl)

# TDataSet.State

Current operational state of the dataset

## Declaration

Source position: db.pas line 1738

`public property TDataSet.State : TDataSetState read FState;`

## Description

State determines the current operational state of the dataset. During it's lifetime, the dataset is in one of many states, depending on which operation is currently in progress:

- If a dataset is closed, the State is dsInactive.
- As soon as it is opened, it is in dsBrowse mode, and remains in this state while changing the cursor position.
- If the Edit or Insert or Append methods is called, the State changes to dsEdit or dsInsert, respectively.
- As soon as edits have been posted or cancelled, the state is again dsBrowse.
- Closing the dataset sets the state again to dsInactive.

There are some other states, mainly connected to internal operations, but which can become visible in some of the dataset's events.

## See also

TDataset.Active |  | Is the dataset open or closed.
TDataset.Edit |  | Set the dataset in editing mode.
TDataset.Insert |  | Insert a new record at the current position.
TDataset.Append |  | Append a new record to the data
TDataset.Post |  | Post pending edits to the database.
TDataset.Cancel |  | Cancel the current editing operation