Navigation:  DAO Object Classes > DaoQueryDef Class >

DaoQueryDef:OpenRecordSet() Method

Previous pageReturn to chapter overviewNext page

Purpose

Creates a new Recordset object

 

Parameters

liType        (Optional) A constant that indicates the type of Recordset to open

lOptions(Optional) A combination of constants that specify characteristics of the new Recordset
lLockEdits(Optional) A constant that determines the locking for the bRecordset

 

Returns

A recordset object

 

Settings

 

You can use one of the following constants for the IType argument

 

ConstantDescription

 

dbOpenTableOpens a table-type Recordset object (Microsoft Jet workspaces only).
dbOpenDynamicOpens a dynamic-type Recordset object, which is similar to an ODBC dynamic cursor. (ODBCDirect workspaces only)
dbOpenDynasetOpens a dynaset-type Recordset object, which is similar to an ODBC keyset cursor.
dbOpenSnapshotOpens a snapshot-type Recordset object, which is similar to an ODBC static cursor.
dbOpenForwardOnlyOpens a forward-only-type Recordset object.

 

You can use a combination of the following constants for the IOptions argument.

 

ConstantDescription

 

dbAppendOnlyAllows users to append new records to the Recordset, but prevents them from editing or deleting existing records (Microsoft Jet dynaset-type Recordset only).
dbSQLPassThroughPasses an SQL statement to a Microsoft Jet-connected ODBC data source for processing (Microsoft Jet snapshot-type Recordset only).
dbSeeChangesGenerates a run-time error if one user is changing data that another user is editing (Microsoft Jet dynaset-type Recordset only). This is useful in applications where multiple users have simultaneous read/write access to the same data.
dbDenyWriteother users from modifying or adding records (Microsoft Jet Recordset objects only).
dbDenyRead Prevents other users from reading data in a table (Microsoft Jet table-type Recordset only).
dbForwardOnly Creates a forward-only Recordset (Microsoft Jet snapshot-type Recordset only). It is provided only for backward compatibility, and you should use the dbOpenForwardOnly constant in the liType argument instead of using this option.
dbReadOnly Prevents users from making changes to the Recordset (Microsoft Jet only). The dbReadOnly constant in the lLockEdits argument replaces this option, which is provided only for backward compatibility.
dbRunAsyncRuns an asynchronous query (ODBCDirect workspaces only).
dbExecDirect Runs a query by skipping SQLPrepare and directly calling SQLExecDirect (ODBCDirect workspaces only). Use this option only when you're not opening a Recordset based on a parameter query. For more information, see the "Microsoft ODBC 3.0 Programmer's Reference."
dbInconsistent Allows inconsistent updates (Microsoft Jet dynaset-type and snapshot-type Recordset objects only).
dbConsistent only consistent updates (Microsoft Jet dynaset-type and snapshot-type Recordset objects only).

 

You can use the following constants for the ILockEdits argument.

 

ConstantDescription

 

dbReadOnlyPrevents users from making changes to the Recordset (default for ODBCDirect workspaces). You can use dbReadOnly in either the lOptions argument or the lLockEdits argument, but not both. If you use it for both arguments, a run-time error occurs.
dbPessimistic Uses pessimistic locking to determine how changes are made to the Recordset in a multiuser environment. The page containing the record you're editing is locked as soon as you use the Edit method (default for Microsoft Jet workspaces).
dbOptimistic optimistic locking to determine how changes are made to the Recordset in a multiuser environment. The page containing the record is not locked until the Update method is executed.
dbOptimisticValue Uses optimistic concurrency based on row values (ODBCDirect workspaces only).
dbOptimisticBatch Enables batch optimistic updating (ODBCDirect workspaces only).

 

Class

DaoQueryDef

 

See Also

DaoRecordSet