Navigation:  DAO Object Classes > DaoRecordset Class >

DaoRecordset:OpenRecordSet() Method

Previous pageReturn to chapter overviewNext page


Open New version of RecordSet and appends it to the recordsets collection



liType(Optional) A constant that indicates the type of Recordset to open, as specified under Settings.
liOptions(Optional) A combination of constants that specify characteristics of the new Recordset, as listed under Settings



A recordset object



From a dynaset- or snapshot-type Recordset, the new Recordset is of the same type. From a table-type Recordset object, the type of the new object is a dynaset-type Recordset. You can't open new Recordset objects from forward-onlytype or ODBCDirect Recordset objects.




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




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.




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).






Dynaset Sample