w3pop.com :: 网络学院 :: ADO :: ADO State 属性
The State property returns a value that describes if the object is open, closed, connecting, executing or retrieving data. The value returns an ObjectStateEnum value. Default is adStateClosed.
State属性的作用是:返回一个用于描述指令对象是否已被打开、关闭、或正在连接、执行以及获取数据的值。这个值将返回一个ObjectStateEnum值。默认值是:adStateClosed。
This property can be used with the Command, Connection, Record, Recordset, and Stream object.
该属性可以通过Command、Connection、Record、Recordset和 Stream对象。
The State property can have a combination of values. If a statement is executing, this property will have a combined value of adStateOpen and adStateExecuting.
这个陈述语句可以拥有一个符合值。如果某条语句正在执行中,那么,这个属性将拥有一个adStateOpena和dStateExecuting的复合值。
object.State |
|
For a Command object: <%
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")
response.write(comm.State)
conn.close %> For a Connection object: <%
set conn=Server.CreateObject("ADODB.Connection")
conn.Provider="Microsoft.Jet.OLEDB.4.0"
conn.Open "c:/webdata/northwind.mdb"
response.write(conn.State) conn.close %> |
Specifies whether an object is open or closed, connecting to a data source, executing a command, or retrieving data.
制定一个对象是否已被打开或关闭,以及是否正在连接数据源,执行一个指令或者获取数据。
| Constant 常量 |
Value 值 |
Description 描述 |
|---|---|---|
| adStateClosed | 0 | The object is closed 对象被关闭 |
| adStateOpen | 1 | The object is open 对象被打开 |
| adStateConnecting | 2 | The object is connecting 对象正在连接 |
| adStateExecuting | 4 | The object is executing a command 对象正在执行一条指令 |
| adStateFetching | 8 | The rows of the object are being retrieved 正在获取对象行 |
评论 (0)
All