RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
TIBClientDataSet.Active Property

Specifies whether the dataset contains data.

Pascal
property Active: Boolean;
C++
__property Boolean Active;

Use Active to determine whether the dataset makes its data available. When Active is false, the dataset is closed; It can't manipulate the data it represents. When Active is true, data can be read or edited using the dataset. 

Setting Active to true: 

1Fills the client dataset with data. If the FileName property is set, this data comes from the specified file. Otherwise, this data is fetched (using the internal source dataset and provider) from the database to which the internal source dataset connects. If the data comes from a database server, The CommandText property indicates what data to fetch. 

2Triggers a BeforeOpen event. 

3Sets the State property to dsBrowse. 

4Opens a cursor into the dataset. 

5Triggers an After Open event. 

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

Setting Active to false: 

1Triggers a BeforeClose event. 

2Sets the State property to dsInactive. 

3Closes the cursor, saving the current data to disk if the FileName property is set, and saving the current data packet to a cache so that it can be restored when the client dataset is reopened. 

4Triggers an AfterClose event.

Note: Calling the Open method sets Active to true; whereas calling the Close method sets Active to false.
 

 

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!