日期:2008-11-18  浏览次数:20926 次


ADO enumeration constants

Each of this enum constants are defined in ADO.

Click each enum below to show its constants, values and description.

Connection object
ConnectOptionEnum
Constant Value Description
adAsyncConnect 16 Opens the connection asynchronously. The ConnectComplete event may be used to determine when the connection is available.
adConnectUnspecified -1 Default. Opens the connection synchronously.

Specifies whether the Open method of a Connection object should return after (synchronously) or before (asynchronously) the connection is established.

connection.Open ConnectionString, UserID, Password, Options


ConnectPromptEnum
Constant Value Description
adPromptAlways 1 Prompts always.
adPromptComplete 2 Prompts if more information is required.
adPromptCompleteRequired 3 Prompts if more information is required but optional parameters are not allowed.
adPromptNever 4 Never prompts.

Specifies whether a dialog box should be displayed to prompt for missing parameters when opening a connection to a data source.

connection.Properties("Prompt") = adPromptNever



Recordset object
CursorLocationEnum
Constant Value Description
adUseClient 3 Uses client-side cursors supplied by a local cursor library. Local cursor services often will allow many features that driver-supplied cursors may not, so using this setting may provide an advantage with respect to features that will be enabled. For backward compatibility, the synonym adUseClientBatch is also supported.
adUseNone 1 Does not use cursor services. (This constant is obsolete and appears solely for the sake of backward compatibility.)
adUseServer 2 Default. Uses data-provider or driver-supplied cursors. These cursors are sometimes very flexible and allow for additional sensitivity to changes others make to the data source. However, some features of the Microsoft Cursor Service for OLE DB (such as disassociated Recordset objects) cannot be simulated with server-side cursors and these features will be unavailable with this setting.

Specifies the location of the cursor service.

recordset.CursorLocation = adUseClient


CursorTypeEnum
Constant Value Description
adOpenDynamic 2 Uses a dynamic cursor. Additions, changes, and deletions by other users are visible, and all types of movement through the Recordset are allowed, except for bookmarks, if the provider doesn't support them.
adOpenForwardOnly 0 Default. Uses a forward-only cursor. Identical to a static cursor, except that you can only scroll forward through records. This improves performance when you need to make only one pass through a Recordset.
adOpenKeyset 1 Uses a keyset cursor. Like a dynamic cursor, except that you can't see records that other users add, although records that other users delete are inaccessible from your Recordset. Data changes by other users are still visible.
adOpenStatic 3 Uses a static cursor. A static copy of a set of records that you can use to find data or generate reports. Additions, changes, or deletions by other users are not visible.
adOpenUnspecified -1 Does not specify the type of cursor.

Specifies the type of cursor used in a Recordset object.

recordset.CursorType = adOpenDynamic


LockTypeEnum
Constant Value Description
adLockBatchOptimistic 4 Indicates optimistic batch updates. Required for batch update mode.
adLockOptimistic 3 Indicates optimistic locking, record by record. The provider us