Microsoft JET Database Engine '80004005' 子查询最多能返回一个记录。kaohe.asp, line122

我坐的asp网页 但是一个标题打开不能正确显示页面,怎么改?
<%
dim pages,maxpages,counts,allcounts,i
dim act
act=Trim(Request.QueryString("act")) //提示这个有问题.
if(isnumeric(id)) then
sql="select * from news where class1 in (select id from leibie where id="&id&") order by jointime desc"
else
sql="select * from news where class1 in (select id from leibie where fromof=(select id from leibie where title='"&title&"')) order by jointime desc"
end if
rs.open sql,conn,1,1
pages=Trim(Request.QueryString("pages"))
counts=20
allcounts=rs.recordcount
if((allcounts\counts)<(allcounts/counts)) then
maxpages=allcounts\counts+1
else
maxpages=allcounts\counts
end if

if(isnumeric(pages)) then
pages=int(pages)
if(pages<1) then
pages=1
else
if(pages>maxpages) then
pages=maxpages
end if
end if
else
pages=1
end if
if(not rs.eof) then
rs.move (pages-1)*counts
end if
for i=1 to counts
if(not rs.eof) then
%>

act给个初值试试追问

试了,不对。。

点上面的申报表就不行  点左边的申报表 就可以  是不是跟id有关系??成功的那个地址后有id。

追答

可以试试id,我觉得可能是返回值的问题居多,跟踪下数据库返回值吧,看系统提示的意思中断在返回值和act的匹配上了。我只能推测到此,抱歉。

温馨提示:答案为网友推荐,仅供参考
第1个回答  2014-03-26
如果你的ID没有传值过来的话,会执行下面的语句,你自己复制到数据库中执行一下,会报错的,你利用title做子查询是有问题的,假设title中含有一个单引号,执行就会报错,你自己想想看
sql="select * from news where class1 in (select id from leibie where fromof=(select id from leibie where title='"&title&"')) order by jointime desc"

另外附赠一句:你网站的登录的录字写成了 “陆”
相似回答