Snapshot-Type CdbRecordset Object

See Also   Methods   Properties

A snapshot-type CdbRecordset object is a static set of records that you can use to examine data in an underlying table or tables. In an ODBCDirect database, a snapshot-type CdbRecordset object corresponds to a static cursor.

Remarks

To create a snapshot-type CdbRecordset object, use the OpenRecordset method on an open database, on another dynaset- or snapshot-type CdbRecordset object, or on a CdbQueryDef object.

A snapshot-type CdbRecordset object can contain fields from one or more tables in a database. In a Microsoft Jet workspace, a snapshot can't be updated. In an ODBCDirect workspace, a snapshot may be updatable, depending on the ODBC driver.

When you create a snapshot-type CdbRecordset object, data values for all fields (except Memo and OLE Object (Long Binary) field data types in .mdb files) are brought into memory. Once loaded, changes made to base table data aren't reflected in the snapshot-type CdbRecordset object data. To reload the snapshot-type CdbRecordset object with current data, use the Requery method or re-execute the OpenRecordset method.

The order of snapshot-type CdbRecordset object data doesn't necessarily follow any specific sequence. To order your data, use an SQL statement with an ORDER BY clause to create the CdbRecordset object. You can also use this technique to filter the records so that only certain records are added to the CdbRecordset object. Using this technique instead of using the Filter or Sort properties or testing each record individually generally results in faster access to your data.

Snapshot-type CdbRecordset objects are generally faster to create and access than dynaset-type CdbRecordset objects because their records are either in memory or stored in TEMP disk space, and the Microsoft Jet database engine doesn't need to lock pages or handle multiuser issues. However, snapshot-type CdbRecordset objects use more resources than dynaset-type CdbRecordset objects because the entire record is downloaded to local memory.