% option explicit dim conn,connstr dim rs,exec dim rs2,exec2 dim ShowClass ShowClass = 999 dim sClass sClass = 999 sClass = Request.QueryString("sclass") if sClass = "" then sClass = 999 end if ShowClass = Request.QueryString("class") if ShowClass = "" then ShowClass = 999 end if Set Conn=Server.CreateObject("ADODB.Connection") connstr ="Provider = Microsoft.Jet.OLEDB.4.0; Data Source ="&Server.MapPath("tline.mdb") Conn.Open connstr if sClass = 999 and ShowClass = 999 then exec="select * from class order by priority" end if if sClass <> 999 then exec="select * from class where autoclassid = " & sClass & " order by priority" end if if ShowClass <> 999 then exec="select * from class where bigclass = " & ShowClass & " order by priority" end if set rs=conn.execute(exec) %>