(紧急再问)asp查询sqlserver数据库,分页显示问题

hradish 2004-09-04 04:09:03
<!-- #include file=conn.asp -->
<%
t3= trim(request("t3"))
Set rs= Server.CreateObject("ADODB.Recordset")
strsql="select * from alleii where lat='"&t3&"'"
Rs.CursorLocation=3
Rs.Open strsql, Conn
dim i,pagenum
i=5
rs.pagesize=i
if request.querystring("pagenum")="" or request.querystring("pagenum")=0 then
pagenum=1
else
pagenum=cint(request.querystring("pagenum"))
rs.absolutepage=pagenum
end if
%>

----------------

<%
i=i-1
rs.movenext
loop
%>
<%
for p=1 to rs.pagecount '逐个输出分页页面
response.write "<a href=chaxun.asp?pagenum="&p&" &t3="&t3&">"&p&"</a> "
next
%>
  <font color="#333333">共有<%=rs.pagecount%>页</font><br>

-----------
如果查询到的记录有25条,
共1 2 3 4 5页
第一页内容可以正常显示(5条)

但点第2 3 4 5页记录的时候出错,

提示
adodb.recordset 错误"800a0bcd"
bof或eof有一个是"真",或者当前记录已被删除,所需要的操作要求一个当前的记录

测试过程中发现,在点第2 3 4 5页的时候"lat"数据不能传递过来
请问是什么原因,谢谢
...全文
129 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
hradish 2004-09-04
  • 打赏
  • 举报
回复
谢谢 zltostem(尘寞)

不过不行
zltostem 2004-09-04
  • 打赏
  • 举报
回复
for p=1 to rs.pagecount '逐个输出分页页面
%>
<a href="chaxun.asp?pagenum='<%=p%>'&t3='<%=t3%>'"><%=p%></a>  <%
next
%>

try~~~
hradish 2004-09-04
  • 打赏
  • 举报
回复
1.
fenlin(大灰狼爱小白兔)

t3=request("t3")不行

2.
sunboby(其实我爱你)

response.write "<a href=chaxun.asp?pagenum="&p&" &t3="&t3&">"&p&"</a> "
应该是
response.write "<a href=chaxun.asp?pagenum="&p&" &t3="&<%=t3%>&">"&p&"</a> "

不行,执行的时候提示语句错误
sunboby 2004-09-04
  • 打赏
  • 举报
回复
response.write "<a href=chaxun.asp?pagenum="&p&" &t3="&t3&">"&p&"</a> "
应该是
response.write "<a href=chaxun.asp?pagenum="&p&" &t3="&<%=t3%>&">"&p&"</a> "
fenlin 2004-09-04
  • 打赏
  • 举报
回复
t3 = request("t3")
sunboby 2004-09-04
  • 打赏
  • 举报
回复
你把t3的值写出来看看有没有啊
response.write t3
hradish 2004-09-04
  • 打赏
  • 举报
回复
这条语句是接受chaxun.htm界面传递来的数值进行查询并显示的

请问该怎么修改?
zorou_fatal 2004-09-04
  • 打赏
  • 举报
回复
你的t3最开始

t3= trim(request("t3"))


这样赋值的时候能起作用吗?

28,404

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧