Language(언어)/ASP

ASP RS,SET 쿼리 형식

대학교닷컴 2013. 11. 19. 14:14
반응형

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") %></br>                                    
          <%
      kk.movenext
      loop
      set kk= nothing