ADO Command Object

Command 对象

ADO Command 对象用于执行面向数据库的一次简单查询。此查询可执行诸如创建、添加、取回、删除或更新记录等动作。

如果该查询用于取回数据,此数据将以一个 RecordSet 对象返回。这意味着被取回的数据能够被 RecordSet 对象的属性、集合、方法或事件进行操作。

Command 对象的主要特性是有能力使用存储查询和带有参数的存储过程。

ProgID

set objCommand=Server.CreateObject("ADODB.command")

属性

属性 Description
ActiveConnection 设置或返回包含了定义连接或 Connection 对象的字符串。
CommandText 设置或返回包含提供者(provider)命令(如 SOL 语句、表格名称或存储的过程调用)的字符串值。默认值为 ""(零长度字符串)。
CommandTimeout 设置或返回长整型值,该值指示等待命令执行的时间(单位为秒)。默认值为 30。
CommandType Set or Return the Type of a Command Object
Name Set or Return the Name of a Command Object
Prepared Indicate Whether to Save the Compiled Version of the Command Before Execution (Prepared Version).
State Return a Value, Which Can Describe the Status of the Command Object, Whether It Is Open, Closed, Connected, Executed, or Retrieving Data.

Method

Method Description
Cancel Cancel a Method's Single Execution.
CreateParameter Create a New Parameter Object
Execute Execute Query, SQL Statement, or Stored Procedure in CommandText Property.

Collection

Collection Description
Parameters All Parameter Objects Containing a Command Object.
Properties All Property Objects Containing a Command Object.