asp网页中的三级查询问题,高手请帮忙!谢谢!

来源:百度知道 编辑:UC知道 时间:2024/05/25 17:28:34
chanpinzhanshi.asp?bigclassname=产品展示&smallId=1
产品里面分为“产品展示”和“新品上市”和“XXXXX”
“产品展示”页面里又分为五个小类。
我想在SQL语句中表示上述地址,我写了一个,打开了是空白的。请大家帮我看下,谢谢!

<%
smallId=request("smallid")
rsql=" select * from TB_NewsInfor where BigClassId=(select BigClassId from TB_BigClass where BigClassName = '"&request("BigClassName")&"' ) "
if smallid<>"" then
rsql=rsql&" and smallId="&smallId
else
rsql=rsql&" order by Newsdate desc"
end if
set rNrs = server.CreateObject("adodb.recordset")
rNrs.cursorlocation=3
rNrs.open rsql,conn,2,2,1
%>

smallId=request("smallid")
rsql=" select * from TB_NewsInfor where BigClassId in (select BigClassId from TB_BigClass where BigClassName = '"&request("BigClassName")&"' ) "
if smallid<>"" then
rsql=rsql&" and smallId="&smallId
else
rsql=rsql&" order by Newsdate desc"
end if
set rNrs = server.CreateObject("adodb.recordset")
rNrs.open rsql,conn,1,3

这样看看

rNrs.cursorlocation=3
rNrs.open rsql,conn,2,2,1------------->rNrs.open rsql,conn,1,1

试试