ADO State 属性
定義と使用方法
State 属性は、オブジェクトの現在の状態(オープン、クローズ、接続中、実行中、データ検索中)を説明する値を返します。この値は、 ObjectStateEnum デフォルト値は adStateClosed です。
この属性は Command、Connection、Record、Recordset、Stream オブジェクトで使用できます。
State 属性は値の組み合わせでできます。例えば、特定のステートメントを実行している場合、この属性には adStateOpen と adStateExecuting の組み合わせ値があります。
State 属性は読み取り専用です。
文法
object.State
インスタンス
Command オブジェクトに対して:
<% 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 %>
Connection オブジェクトに対して:
<% 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 %>