컴퓨터이야기/Language

ASP RS,SET 쿼리 형식

집합원 2025. 3. 4. 10:10
반응형

RS,SET 쿼리 형식

rs 단순리스트 쿼리
strSQL = "select * from 테이블명"
strSQL = strSQL  &  " where 1=1 "
strSQL = strSQL  &  " and  조건 "  
rs.open strSQL ,db,1
'response.write strSQL

if not rs.eof then
  컬럼1  =  rs(" 컬럼1")
  컬럼2  =  rs("컬럼2")

end if
rs.close
db.close

SET 단순 리스트 쿼리

 strSQL = "select * from 테이블명"
strSQL = strSQL  &  " where 1=1 "
strSQL = strSQL  &  " and  조건 "
'response.write strSQL
set kk = db.execute(strSQL)

 if not kk.eof then
  컬럼1  =  kk(" 컬럼1")
  컬럼2  =  kk("컬럼2")
end if
set kk= nothing
set db = nothing  

SET 반복 리스트 쿼리

strSQL = "select * from 테이블명"
strSQL = strSQL  &  " where 1=1 "
strSQL = strSQL  &  " and  조건 "
'response.write strSQL
set kk = db.execute(strSQL)
           
do while not kk.eof
 %>
<input type="radio" name="" value="<%= kk("컬럼1")%>/<%=kk("컬럼2")%>" onclick="selectGbn('<%= kk("컬럼3") %>');" ><%= kk컬럼1") %>                                  
<%
      kk.movenext
      loop
      set kk= nothing