ADO enumeration constants

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
  
ConstantValueDescription
adAsyncConnect16Opens the connection asynchronously. The ConnectComplete event may be used to determine when the connection is available.
adConnectUnspecified-1Default. 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
  
ConstantValueDescription
adPromptAlways1Prompts always.
adPromptComplete2Prompts if more information is required.
adPromptCompleteRequired3Prompts if more information is required but optional parameters are not allowed.
adPromptNever4Never 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
  
ConstantValueDescription
adUseClient3Uses 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.
adUseNone1Does not use cursor services. (This constant is obsolete and appears solely for the sake of backward compatibility.)
adUseServer2Default. 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
  
ConstantValueDescription
adOpenDynamic2Uses 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.
adOpenForwardOnly0Default. 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.
adOpenKeyset1Uses 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.
adOpenStatic3Uses 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-1Does not specify the type of cursor.

Specifies the type of cursor used in a Recordset object.

recordset.CursorType = adOpenDynamic

LockTypeEnum
  
ConstantValueDescription
adLockBatchOptimistic4Indicates optimistic batch updates. Required for batch update mode.
adLockOptimistic3Indicates optimistic locking, record by record. The provider uses optimistic locking, locking records only when you call the Update method.
adLockPessimistic2Indicates pessimistic locking, record by record. The provider does what is necessary to ensure successful editing of the records, usually by locking records at the data source immediately after editing.
adLockReadOnly1Indicates read-only records. You cannot alter the data.
adLockUnspecified-1Does not specify a type of lock. For clones, the clone is created with the same lock type as the original.

Specifies the type of lock placed on records during editing.

recordset.LockType = adLockReadOnly

Command object
 
ParameterDirectionEnum
  
ConstantValueDescription
adParamInput1Default. Indicates that the parameter represents an input parameter.
adParamInputOutput3Indicates that the parameter represents both an input and output parameter.
adParamOutput2Indicates that the parameter represents an output parameter.
adParamReturnValue4Indicates that the parameter represents a return value.
adParamUnknown0Indicates that the parameter direction is unknown.

Specifies whether the Parameter represents an input parameter, an output parameter, both an input and an output parameter, or the return value from a stored procedure.

command.Parameters(1).Direction = adParamInput

Miscallenous
 
CommandTypeEnum
  
ConstantValueDescription
adCmdUnspecified-1Does not specify the command type argument.
adCmdText1Evaluates CommandText as a textual definition of a command or stored procedure call.
adCmdTable2Evaluates CommandText as a table name whose columns are all returned by an internally generated SQL query.
adCmdStoredProc4Evaluates CommandText as a stored procedure name.
adCmdUnknown8Default. Indicates that the type of command in the CommandText property is not known.
adCmdFile256Evaluates CommandText as the file name of a persistently stored Recordset. Used with Recordset.Open or Requery only.
adCmdTableDirect512Evaluates CommandText as a table name whose columns are all returned. Used with Recordset.Open or Requery only. To use the Seek method, the Recordset must be opened with adCmdTableDirect.

Specifies how a command argument should be interpreted.

Set recordset = command.Execute (RecordsAffected, Parameters, Options)
-or-
command.Execute RecordsAffected, Parameters, Options
-or-
command.CommandType = adCmdStoredProc
-or-
connection.Execute CommandText, RecordsAffected, Options
-or-
Set recordset = connection.Execute (CommandText, RecordsAffected, Options)
-or-
recordset.Open Source, ActiveConnection, CursorType, LockType, Options
-or-
recordset.Requery Options

ExecuteOptionEnum
  
ConstantValueDescription
adAsyncExecute16Indicates that the command should execute asynchronously.
adAsyncFetch32Indicates that the remaining rows after the initial quantity specified in the property should be retrieved asynchronously.
adAsyncFetchNonBlocking64Indicates that the main thread never blocks while retrieving. If the requested row has not been retrieved, the current row automatically moves to the end of the file.

If you open a Recordset from a Stream containing a persistently stored Recordset, adAsyncFetchNonBlocking will not have an effect; the operation will be synchronous and blocking.

adAsynchFetchNonBlocking has no effect when the adCmdTableDirect option is used to open the Recordset.

adExecuteNoRecords128Indicates that the command text is a command or stored procedure that does not return rows (for example, a command that only inserts data). If any rows are retrieved, they are discarded and not returned.

adExecuteNoRecords can only be passed as an optional parameter to the Command or Connection Execute method.

adExecuteStream1024Indicates that the results of a command execution should be returned as a stream.

adExecuteStream can only be passed as an optional parameter to the Command Execute method.

adExecuteRecord2048Indicates that the CommandText is a command or stored procedure that returns a single row which should be returned as a Record object.
adOptionUnspecified-1Indicates that the command is unspecified.

Specifies how a provider should execute a command. This is the values that the options parameter in an execute command accept

Set recordset = command.Execute (RecordsAffected, Parameters, Options)
-or-
command.Execute RecordsAffected, Parameters, Options
-or-
command.CommandType = adCmdStoredProc
-or-
connection.Execute CommandText, RecordsAffected, Options
-or-
Set recordset = connection.Execute (CommandText, RecordsAffected, Options)
-or-
recordset.Open Source, ActiveConnection, CursorType, LockType, Options
-or-
recordset.Requery Options

ObjectStateEnum
  
ConstantValueDescription
adStateClosed0Indicates that the object is closed.
adStateOpen1Indicates that the object is open.
adStateConnecting2Indicates that the object is connecting.
adStateExecuting4Indicates that the object is executing a command.
adStateFetching8Indicates that the rows of the object are being retrieved.

Specifies whether an object is open or closed, connecting to a data source, executing a command, or retrieving data. Read only.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值