ADO CommandType 속성


❮ 완전한 명령 개체 참조

CommandType 속성 은 Command 개체의 형식을 정의 하는 CommandTypeEnum 값을 설정하거나 반환 합니다. 기본값은 adCmdUnknown입니다.

유형을 지정하지 않으면 ADO가 공급자에게 연락하여 명령 유형을 결정해야 합니다. 그러나 유형을 지정하면 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
%>

CommandTypeEnum 값

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.
adCmdTable 2 Evaluates CommandText as a table name whose columns are all returned by an internally generated SQL query.
adCmdStoredProc 4 Evaluates CommandText as a stored procedure name.
adCmdUnknown 8 Default. Indicates that the type of command in the CommandText property is not known.
adCmdFile 256 Evaluates CommandText as the file name of a persistently stored Recordset. Used with Recordset.Open or Requery only.
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.

❮ 완전한 명령 개체 참조