ADO 命令对象


命令对象

ADO Command 对象用于对数据库执行单个查询。查询可以执行创建、添加、检索、删除或更新记录等操作。

如果查询用于检索数据,则数据将以 RecordSet 对象的形式返回。这意味着检索到的数据可以通过 Recordset 对象的属性、集合、方法和事件进行操作。

Command 对象的主要功能是能够使用带参数的存储查询和过程。


程序ID

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

特性

Property Description
ActiveConnection Sets or returns a definition for a connection if the connection is closed, or the current Connection object if the connection is open
CommandText Sets or returns a provider command
CommandTimeout Sets or returns the number of seconds to wait while attempting to execute a command
CommandType Sets or returns the type of a Command object
Name Sets or returns the name of a Command object
Prepared Sets or returns a Boolean value that, if set to True, indicates that the command should save a prepared version of the query before the first execution
State Returns a value that describes if the Command object is open, closed, connecting, executing or retrieving data

方法

Method Description
Cancel Cancels an execution of a method
CreateParameter Creates a new Parameter object
Execute Executes the query, SQL statement or procedure in the CommandText property

收藏

Collection Description
Parameters Contains all the Parameter objects of a Command Object
Properties Contains all the Property objects of a Command Object