当前位置: 首页 > 网络学院 > 服务端脚本教程 > ADO > ADO CommandType 属性
The CommandType property sets or returns a CommandTypeEnum value that defines the type of the Command object. Default is adCmdUnknown.
CommandType属性的作用是:设置或返回用于定义指令对象类型的CommandTypeEnum值。默认值为:adCmdUnknown。
If you do not specify the type, ADO will need to contact the provider to determine the type of the command. However, if you do specify the type, ADO will be able to process the command faster.
如果你没有指定类型,那么ADO将会与技术提供对象[provider]进行信息交互,以确定指令的类型。然而,如果你已经指定了类型,ADO将会更快地执行指令对象。
objcommand.CommandType |
<% set conn=Server.CreateObject("ADODB.Connection") conn.Provider="Microsoft.Jet.OLEDB.4.0" conn.Open "c:/webdata/northwind.mdb" set comm=Server.CreateObject("ADODB.Command") comm.CommandText="orders" comm.CommandType=adCmdTable response.write(comm.CommandType) conn.close %> |
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. 指示提供者应该将Source作为命令的文本定义来计算。 |
adCmdTable | 2 | Evaluates CommandText as a table name whose columns are all returned by an internally generated SQL query. 指示ADO生成SQL查询以便从在Source中命名的表中返回所有行 |
adCmdStoredProc | 4 | Evaluates CommandText as a stored procedure name. 将CommandText作为一个已存的程序名称 |
adCmdUnknown | 8 | Default. Indicates that the type of command in the CommandText property is not known. 默认值。指定未知的CommandText属性命令 |
adCmdFile | 256 | Evaluates CommandText as the file name of a persistently stored Recordset. Used with Recordset.Open or Requery only. 指示应从在Source中命名的文件中恢复保留(保存的)Recordset。它仅能与Recordset.Open 或 Requery 指令一起使用 |
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. This value cannot be combined with the ExecuteOptionEnum value adAsyncExecute. 指示提供者更改从在 Source 中命名的表中返回所有行 / 将CommandText作为一个表的名称(该表的列全部是通过内部的SQL查询语句返回的)。它仅适用Recordset.Open 或 Requery 指令;如果需要使用查找方式,那么Recordset必须以adCmdTableDirect打开。这个值不能与ExecuteOptionEnum值 adAsyncExecute一起使用 |