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
Constant | Description |
dbOpenTable | Opens a table-type Recordset object (Microsoft Jet workspaces only). |
dbOpenDynamic | Opens a dynamic-type Recordset object, which is similar to an ODBC dynamic cursor. (ODBCDirect workspaces only) |
dbOpenDynaset | Opens a dynaset-type Recordset object, which is similar to an ODBC keyset cursor. |
dbOpenSnapshot | Opens a snapshot-type Recordset object, which is similar to an ODBC static cursor. |
dbOpenForwardOnly | Opens a forward-only-type Recordset object. |
You can use a combination of the following constants for the IOptions argument.
Constant | Description |
dbAppendOnly | Allows users to append new records to the Recordset, but prevents them from editing or deleting existing records (Microsoft Jet dynaset-type Recordset only). |
dbSQLPassThrough | Passes an SQL statement to a Microsoft Jet-connected ODBC data source for processing (Microsoft Jet snapshot-type Recordset only). |
dbSeeChanges | Generates 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. |
dbDenyWrite | other 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. |
dbRunAsync | Runs 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.
Constant | Description |
dbReadOnly | Prevents 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
See Also