ClassicASP Adodb.Command 사용법
페이지 정보
본문
1. 쿼리 사용시
SQL = "DELETE TABLE WHERE IDX = ?"
Set Cmd = Server.CreateOjbect("ADODB.Command")
width Cmd
.ActiveConnection = objConn
.CommandType = adCmdText
.CommandText = SQL
.Parameters.Append Cmd.CreateParameter("IDX", adInteger, adParamInput, 0, idx)
End width
Set Rs = Cmd.Execute()
Set Cmd = Nothing
2. 프로시저( Procedures ) 사용시
Set Cmd = Server.CreateObject("ADODB.Command")
with Cmd
.ActiveConnection = objConn
.CommandType = adCmdStoredProc
.CommandText = "[dbo].[SP_NAME]"
.Parameters.Append .CreateParameter("@JUMSU" , adNumeric , adParamInput)
.Parameters.Append .CreateParameter("@IDX" , adInteger , adParamOutput, 0)
.Parameters("@JUMSU").Precision = 10
.Parameters("@JUMSU").NumericScale = 0
.Execute , , adExecuteNoRecords
IDX = .Parameters("@IDX")
End with
Set Cmd = Nothing
3. 파라미터 설정
입력값 : .Parameters.Append Cmd.CreateParameters(parameter, type, adParamInput,typeSize, value)
출력값 : .Parameters.Append Cmd.CreateParameters(parameter, type, adParamOutput,typeSize)
자료 출처
http://wvbiz.tistory.com/223
SQL = "DELETE TABLE WHERE IDX = ?"
Set Cmd = Server.CreateOjbect("ADODB.Command")
width Cmd
.ActiveConnection = objConn
.CommandType = adCmdText
.CommandText = SQL
.Parameters.Append Cmd.CreateParameter("IDX", adInteger, adParamInput, 0, idx)
End width
Set Rs = Cmd.Execute()
Set Cmd = Nothing
2. 프로시저( Procedures ) 사용시
Set Cmd = Server.CreateObject("ADODB.Command")
with Cmd
.ActiveConnection = objConn
.CommandType = adCmdStoredProc
.CommandText = "[dbo].[SP_NAME]"
.Parameters.Append .CreateParameter("@JUMSU" , adNumeric , adParamInput)
.Parameters.Append .CreateParameter("@IDX" , adInteger , adParamOutput, 0)
.Parameters("@JUMSU").Precision = 10
.Parameters("@JUMSU").NumericScale = 0
.Execute , , adExecuteNoRecords
IDX = .Parameters("@IDX")
End with
Set Cmd = Nothing
3. 파라미터 설정
입력값 : .Parameters.Append Cmd.CreateParameters(parameter, type, adParamInput,typeSize, value)
출력값 : .Parameters.Append Cmd.CreateParameters(parameter, type, adParamOutput,typeSize)
자료 출처
http://wvbiz.tistory.com/223
댓글목록
등록된 댓글이 없습니다.