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 %>