RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TDataSet.State Property

Indicates the current operating mode of the dataset.

Pascal
property State: TDataSetState;
C++
__property TDataSetState State;

Examine State to determine the current operating mode of the dataset. State determines what can be done with data in a dataset, such as editing existing records or inserting new ones. The dataset state constantly changes as an application processes data.  

Opening a dataset changes State from dsInactive to dsBrowse. An application can call Edit to put a dataset into dsEdit state, or call Insert to put a dataset into dsInsert state. If a dataset is a TTable or TClientDataSet object, an application can call SetKey or SetRange to put the dataset into dsSetKey state. 

Posting or canceling edits, insertions, or deletions, changes State from its current state to dsBrowse. Closing a dataset changes its state to dsInactive. 

Some states, such as dsCalcFields, dsFilter, dsNewValue, dsOldValue, and dsCurValue cannot be seen or set directly by an application. These states are automatically set when OnCalcFields and OnFilterRecord events occur, or when an application accesses certain field properties. 

 

Active 

CachedUpdates 

Filtered 

OnCalcFields 

OnFilterRecord 

Close 

Edit 

Insert 

Open 

TField 

SetKey 

SetRange 

Responding to Changes Mediated by the Data Source 

Determining Dataset States 

Using Internally Calculated Fields in Client Datasets 

Programming a Calculated Field

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!