Working with Record Sets

From RAD Studio
Jump to: navigation, search

Go Up to Connecting an ADO Dataset to a Data Store


The Recordset property provides direct access to the ADO recordset object underlying the dataset component. Using this object, it is possible to access properties and call methods of the recordset object from an application. Use of Recordset to directly access the underlying ADO recordset object requires a good working knowledge of ADO objects in general and the ADO recordset object in specific. Using the recordset object directly is not recommended unless you are familiar with recordset object operations. Consult the Microsoft Data Access SDK help for specific information on using ADO recordset objects.

The RecordSetState property indicates the current state of the underlying recordset object. RecordsetState corresponds to the State property of the ADO recordset object. The value of RecordsetState is either stOpen, stExecuting, or stFetching. (TObjectState, the type of the RecordsetState property, defines other values, but only stOpen, stExecuting, and stFetching pertain to recordsets.) A value of stOpen indicates that the recordset is currently idle. A value of stExecuting indicates that it is executing a command. A value of stFetching indicates that it is fetching rows from the associated table (or tables).

Use RecordsetState values to perform actions dependent on the current state of the dataset. For example, a routine that updates data might check the RecordsetState property to see whether the dataset is active and not in the process of other activities such as connecting or fetching data.

See Also