Database Variables


When you need to work with a database, you'll need to declare a variable of the data type named Database. The following statement declares such a variable:

Dim dbBooks As Database   ' Declare a database variable

The database variable will provide the connection to the database throughout your code.

You'll also need to create Dynaset and Snapshot variables from time to time. A dynaset is a recordset that remains active; if the recordset data changes, the corresponding dynaset data changes also. Think of a dynaset as being a link to the database table's records. A snapshot is a one-time picture of the recordset. The recordset works like a copy of a selected recordset; when the original recordset changes, the copy doesn't change.