J.2. Recordset.Open Method Options

There are 30 Win32 Registry functions that you can use from VBA. This section describes only 25 of them, because the remaining five require specialist knowledge of Windows security, which is well beyond the scope of this book.

J.2.1. CursorType Argument Options (CursorTypeEnum Values)

ConstantValueDescription
AdOpenUnspecified−1Hidden. No cursor type is specified.
AdOpenForwardOnly0Default. Specifies a forward-only cursor. This is similar to a static cursor, except that you can only scroll forward through the records.
AdOpenKeyset1Specifies a keyset cursor. This is similar to a dynamic cursor, except that records added by other users are not reflected in your recordset; however, records that other users delete are inaccessible in your recordset.
AdOpenDynamic2Specifies a dynamic cursor. In this cursor type, all additions, deletions, and modifications made by other users are visible in your recordset, and all types of row movement are allowed. If the provider supports bookmarks, they too are allowed.
AdOpenStatic3Specifies a static cursor. This cursor type is read-only, and additions, deletions, and modifications made by other users are invisible in your recordset.

J.2.2. LockType Argument Options (LockTypeEnum Values)

ConstantValueDescription
AdLockUnspecified−1Hidden. A lock type is not specified. Clones are created with the same lock type as their original.
AdLockReadOnly1Specifies a read-only recordset.
AdLockPessimistic2Specifies pessimistic locking at record-level.
AdLockOptimistic3Specifies pessimistic locking at record-level. The record is locked only when you call the Update method.
adLockBatchOptimistic4Specifies optimistic locking for batch updated.

J.2.3. Options Argument (Constant Values)

The Options argument can be one or more of the following constant values.

ConstantValueDescription
CommandTypeEnum values  
adCmdUnspecified−1Hidden. No command type is specified.
AdCmdText1The Source argument is a command or the name of a stored procedure.
AdCmdTable2The Source argument is the name of a table.
AdCmdStoredProc4The Source argument is the name of a stored procedure.
AdCmdUnknown8Default. The type of command in the Source argument is unknown.
AdCmdFile256The Source argument is the name of a stored Recordset.
adCmdTableDirect512The Source argument is the name of a table. This option cannot be combined with adAsyncExecute.
ExecuteOptionEnum values  
adOptionUnspecified−1Hidden. The command is not specified.
AdAsyncExecute16The command executes asynchronously. This option cannot be combined with adCmdTableDirect.
AdAsyncFetch32The rows that remain to be retrieved after those specified by the CacheSize property are to be retrieved asynchronously.
adAsyncFetchNonBlocking64The main thread never blocks while retrieving data, so if the requested row has not been retrieved, the current row automatically moves to the end of the file.
  This setting is ignored if the adCmdTableDirect option is used, or if you open a recordset from a stream that contains a persistently stored recordset.
adExecuteNoRecords128The Source argument is a command or stored procedure that does not return records.
AdExecuteRecord2048Hidden. The Source argument is a command or stored procedure that returns a single row as a Record object.

Note: For information about how to view hidden objects in the Object Browser, refer to Chapter 2.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.247.5