ADO enumeration constants

原创 2004年09月17日 13:50:00
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 uses optimistic locking, locking records only when you call the Update method.
adLockPessimistic 2 Indicates 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.
adLockReadOnly 1 Indicates read-only records. You cannot alter the data.
adLockUnspecified -1 Does 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
  
Constant Value Description
adParamInput 1 Default. Indicates that the parameter represents an input parameter.
adParamInputOutput 3 Indicates that the parameter represents both an input and output parameter.
adParamOutput 2 Indicates that the parameter represents an output parameter.
adParamReturnValue 4 Indicates that the parameter represents a return value.
adParamUnknown 0 Indicates 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
  
Constant Value Description
adCmdUnspecified -1 Does not specify the command type argument.
adCmdText 1 Evaluates CommandText as a textual definition of a command or stored procedure call.
adCmdTable 2 Evaluates CommandText as a table name whose columns are all returned by an internally generated SQL query.
adCmdStoredProc 4 Evaluates CommandText as a stored procedure name.
adCmdUnknown 8 Default. Indicates that the type of command in the CommandText property is not known.
adCmdFile 256 Evaluates CommandText as the file name of a persistently stored Recordset. Used with Recordset.Open or Requery only.
adCmdTableDirect 512 Evaluates 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
  
Constant Value Description
adAsyncExecute 16 Indicates that the command should execute asynchronously.
adAsyncFetch 32 Indicates that the remaining rows after the initial quantity specified in the property should be retrieved asynchronously.
adAsyncFetchNonBlocking 64 Indicates 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.

adExecuteNoRecords 128 Indicates 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.

adExecuteStream 1024 Indicates 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.

adExecuteRecord 2048 Indicates that the CommandText is a command or stored procedure that returns a single row which should be returned as a Record object.
adOptionUnspecified -1 Indicates 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
  
Constant Value Description
adStateClosed 0 Indicates that the object is closed.
adStateOpen 1 Indicates that the object is open.
adStateConnecting 2 Indicates that the object is connecting.
adStateExecuting 4 Indicates that the object is executing a command.
adStateFetching 8 Indicates 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.

Java 获取Enumeration类型的集合方法

创建一个Enumeration集合: 今天看到老师上课用到了下述的第二种方法,然后也提到了第一种方法,我感觉还是有必要记录一下,以后还会记录更过。   说明: 我们知道Enumeration是一个接口...
  • hua631150873
  • hua631150873
  • 2013年09月14日 23:54
  • 3532

JavaScript中类似java常量constants使用方法

JavaScript中类似java常量constants使用方法 –2016.4.12在写js和后台交互传参的时候,经常要用到一些常量,类似java里面的static属性,如果在js中写死,要是以后常...
  • juncai91
  • juncai91
  • 2016年10月18日 19:04
  • 1193

Java类集框架——foreach及Enumeration接口

学习目标 掌握foreach对集合的输出支持。 掌握Enumeration接口及使用要求。 JDK1.5之后增加了许多新的功能,其中foreach可以输出数组,实际上foreach语法中...
  • u013087513
  • u013087513
  • 2016年08月19日 11:01
  • 661

如何参数化getParameterNames以避免MyEclipse告警

背景 在MyEclipse2014环境下,使用JDK
  • u010096900
  • u010096900
  • 2014年09月20日 12:00
  • 1095

ADO读取Excel的简单例子

一、简单说明: 工程名字ADO_Excel,类型是console app, 非empty有预编译头stdafx.h。 编译说明: 1.确保C盘下面路径有msado15.dll,没有安装office2...
  • Blues1021
  • Blues1021
  • 2015年02月04日 12:14
  • 6054

usb枚举过程 enumeration 流程说明

先转载一篇关于usb enumeration不错的文章。 USB枚举过程 USB Enumeration     USB架构中, hub负责检测设备的连接和断开,利用其中断IN端点(Interr...
  • a_jige
  • a_jige
  • 2013年10月14日 15:48
  • 1602

在JSP中使用常量un标签的使用

希望不使用脚本就可以在JSP页面中使用应用程序常量——Java类中定义的public static字段。 解决方案 使用Jakarta Taglibs 非标准标签库提供的“bind”标签来创建一个...
  • u010317990
  • u010317990
  • 2014年03月18日 16:03
  • 625

[疯狂Java]集合:Collections工具类、Enumeration(摒弃)

1. Collections工具类简介:     1) Java提供的专门用来操作集合的工具类(全部都是静态工具方法),可以操作Set、List、Map;     2) 主要功能包括:        ...
  • Lirx_Tech
  • Lirx_Tech
  • 2016年06月01日 13:37
  • 735

Windows下C++访问数据库(ADO)

C++利用ADO访问数据库还是比较方便的,我参考网上其它资料把ADO到一个类中,这样调用起来会更加的方便 这个类单线程访问数据库没有问题,提供了查询、增加、删除和修改的接口。 并行访问的话会有...
  • luke2834
  • luke2834
  • 2015年08月19日 12:07
  • 1831

Delphi下的原生ADO使用方法

本文向您揭示在Delphi中使用ADO是如何轻而易举,结合了ADO的Delphi应用程序,将不再依赖于BDE。 ADO的精髓在于利用简单的COM指令来快速方便的访问ODBC数据源,微软的表格、...
  • Hmillet
  • Hmillet
  • 2016年03月30日 09:55
  • 2439
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:ADO enumeration constants
举报原因:
原因补充:

(最多只允许输入30个字)