View Single Post
  #4 (permalink)  
Old February 23rd, 2004, 03:25 AM
DaveGerard DaveGerard is offline
Friend of Wrox
 
Join Date: Sep 2003
Location: Minneapolis, MN, USA.
Posts: 171
Thanks: 0
Thanked 1 Time in 1 Post
Default

How about a different approach to this? Provided that you are passing the RsType to the page.

RsType = request("RsType")

select case RsType
    case "Student"
        MySql = "select * from tbl_student"
    case "Teacher"
        MySql = "select * from tbl_teacher"
    case "Subject"
        MySql = "select * from tbl_subject"
    case else
        MySql = "select * from tbl_student"
end select

set rs = server.createobject("adodb.recordset")
sql = MySql
rs.open sql, objConn
if not rs.eof then
    do while not rs.eof
        response.write rs("Field")
    rs.movenext
    loop
end if
rs.close
set rs = nothing