OpenRecordset(active)

Returns the Recordset object representing a set of records that satisfy query conditions. The created object is added to the GeoDatabase::Recordsets or ExternalDatabase::Recordsets collection. A name (on the basis of query name) and an internal number are assigned to the object. The object name is based on the query name with possible numerical suffix.

The optional logical argument specifies the initial state of the recordset. If the active argument is True, the recordset is in the active state. The active state means that you can position records in the recordset, access, add, modify, and remove records. If the active argument is False, the recordset is in the passive state. The passive state means that you only can add records of the recordset to a table of GDB or external database using the Recordset::Update method and remove all records of the recordset from a table of GDB or external database using the Recordset::Clean method. To change the recordset state from passive to active, use the Recordset::Refresh method and from active to passive – the Recordset:Deactivate method. Use the Recordset::IsActive property to determine the recordset state.

The recordset creation time is less in the passive state than in the active one. Besides, a recordset in the passive state consumes less system resources on both the server side (in case of external database) as well as on the client side. If an application performs adding records or removing all records of the recordset, it is recommended to create a recordset in the passive state. The default value of the state argument is True (the recordset is in the active state).