[MS-SQL] Parameters 를 이용한 쿼리실행
작성자 : 김영철
등록날짜 : 2009.01.23 01:16
Parameters를 이용한 쿼리 사용법
Set cmd = Server.CreateObject("ADODB.Command")
With cmd
.ActiveConnection = dbcEtoosIpsi
.CommandType = adCmdText
.CommandText = "SELECT distinct a, b FROM t_table WHERE a = ? " &_
"and b= ? order by c"
.Parameters.Append .CreateParameter("@strUnivNM", adVarChar, adParamInput, 100, strUnivNM)
.Parameters.Append .CreateParameter("@strDeptNM", adVarChar, adParamInput, 100, strDeptNM)
Set rs = .Execute()
End With
Set cmd = Nothing
파라메터를 이용하면 쿼리가 저장되어 효율성이 높아진단다.
adChar(129) /adInteger(3)/ adVarChar(200) / adParamInput(1)
[출처] 락
"쇼핑몰·홈페이지·오픈마켓
블로그·페이스북·이메일 등의 각종 마케팅 글쓰기, 각종 광고, 영업, 판매, 제안서, 전단지 반응율 3배×10배 이상 높이는 마법의 8단계 공식" |
![]() |
☞자세히보기 |
|
|