Reviewing Recordsets

A recordset is a set of records selected from a data source. Recordsets are available in two basic forms: dynasets and snapshots.

Dynaset

A dynaset is a recordset with dynamic properties. Dynasets are most valuable when data must be dynamic, as in an airline reservation system.

During its lifetime, a recordset object in dynaset mode (usually called a dynaset) stays synchronized with the data source by:

In a multi-user environment, other users may edit or delete records in your dynaset or add records to the table your dynaset represents.

If you have multiple connections to the same database (i.e. multiple DataFind controls), recordsets associated with those connections have the same status as the recordsets of other users.

Notes:

A dynaset is a dynamic but fixed set of records. New records that meet the selection criteria after the dynaset-type recordset has been created are not added to the recordset. This includes records added by other users.

Similarly, if a record changes after the dynaset has been created and it no longer meets the criteria, that record is not removed from the dynaset.

When using the Jet engine, dynasets have bookmarks, but snapshots do not. Bookmarks are required if the recordset is not read-only and the same recordset is being shared between channels.

Snapshot

A snapshot is a recordset that reflects a static view of the data as it existed when the snapshot was created. Once you open the snapshot, the record values do not change until you rebuild the snapshot by calling Requery.

You can create updateable or read-only snapshots. An updateable snapshot reflects updates and deletions made by your program but not changes to record values made by other users. Records added to a snapshot become visible to the snapshot when you call Requery.

Snapshots are valuable when you need the data to remain fixed during your operations, such as when you are generating a report or performing calculations. Because the data source can diverge considerably from your snapshot, it is a good idea to rebuild it from time to time.

Snapshots are available only if the ODBC driver you are using supports static cursors.

Notes:

  1. Snapshots may not be updateable for some ODBC drivers. Check your driver documentation for the supported cursor types and the supported concurrency types.

  2. VoiceError event: code 3197. When using a bound data control, this code tells you that the data control could not update the record because the data had been changed already by another process or another data control. Ignore this code by setting the Ignore flag in the VoiceError event. You can set this field directly through the Fields object or refresh the database )although this may cause other channels to lose their position). This error generally occurs if the data is being changed from two different sources (e.g. two separate data controls).

Read about creating and accessing databases in VBVoice.