O'Reilly logo

Access™ 2007 VBA Programmer's Reference by Armen Stein, Geoffrey Griffith, Rob Cooper, Teresa Hennig

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

D.4. OpenRecordset Constants

You'll use a variety of constants when writing VBA code. The following tables list just a few of the constants you might use when opening a DAO recordset.

NOTE

A runtime error occurs if you attempt to use dbOpenTable in the following Microsoft Access workspace situations:

When the recordset is based on a QueryDef

When the Source argument refers to an SQL statement or TableDef that refers to a linked table

The following table lists the constants that can be specified for the Type argument.

ConstantDescription
dbOpenTableReturns an editable dataset consisting of records from a single local table only. Cannot be used with linked tables (Microsoft Access workspaces only).
dbOpenDynasetReturns an editable dataset consisting of pointers to records in a table or query. Can be used on multiple local and linked tables (Microsoft Access workspaces only).
dbOpenSnapshotReturns a read-only dataset consisting of a copy of records in a table or query. Can be used on multiple local and linked tables (Microsoft Access workspaces only).
dbOpenForwardOnlyReturns an editable dataset consisting of records in a table. Use this option when you only need to move through the dataset in one pass and in one direction—forward (Microsoft Access workspaces only).

The following table lists the constants that can be specified for the Options argument.

The dbInconsistent and dbConsistent constants are mutually exclusive. Similarly you cannot supply a LockEdits argument on a recordset ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required