标题:求助]查询出来的信息怎么分页显示出来
只看楼主
zk20716
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2005-5-17
 问题点数:0 回复次数:1 
求助]查询出来的信息怎么分页显示出来
[我查询出来的信息,可以分页显示,但是不能换页,请各位高手知道一下,代码如下 <% if request.Form("submit2")="搜索" then select1 = request.QueryString("select1") select1 = request.Form("select1") txttitle = request.Form("txttitle") set rs = server.CreateObject("ADODB.Recordset") if request.Form("select1")="" and request.Form("txttitle")="" then rs.open "select newid as 新闻ID ,newtitle as 新闻标题,newasstitle as 新闻副标题 ,newtime as 上传时间,newstpye as 新闻类型,newOfferMan as 上传人用户名 from TYnew where newstart = '未审查'",cn,3,2 rs.pagesize = 10 page = clng(request("page")) if page < 1 then page = 1 if page > rs.pagecount then page = rs.pagecount %> </p> <table border="0" height=50 align="center" class="txt_border" > <tr><td></td> <%for i = 0 to rs.fields.count-1 'response.Write "<td>"&rs.fields(i).name&"</td>" next%> </tr> <% rs.absolutepage = page for ipage =1 to rs.pagesize recno = (page-1) *rs.pagesize+ipage %> <tr><td></td> <%for i = 0 to rs.fields.count-1%> <td><a href="updatenew.asp?newID=<%=rs.fields(0)%>&pagestart=1"> <%=rs.fields(i).value%></a> </td> <%next%> </tr> <% rs.movenext if rs.eof then exit for next %> </table> <span class="style31"> <p align="center"> <% if page <>1 then response.Write "<a href = updatenew2.asp?page=1&selete1 ="&request.Form("select1")&">第一页</a>&nbsp;&nbsp;" response.Write "<a href = updatenew2.asp?page=" & (page-1) & "&selete1 ="&request.Form("select1")&"> 上一页</a>&nbsp;&nbsp;" end if if page <> rs.pagecount then response.Write "<a href = updatenew2.asp?page=" & (page+1) & "&selete1 ="&request.Form ("select1")&"> 下一页</a>&nbsp;&nbsp;" response.Write "<a href = updatenew2.asp?page=" & rs.pagecount &"&selete1="&request.Form("select1")&">最后一页</a>" end if %> </p> <p align="center">页数:<%=page%>/<%=rs.pagecount%> </p></span> <%end if%>
搜索更多相关主题的帖子: request Form txttitle 
2005-05-17 13:24
hxfly
Rank: 5Rank: 5
等 级:贵宾
威 望:17
帖 子:5807
专家分:108
注 册:2005-4-7
得分:0 
你自己发过的帖子 有人帮助你解答了 你自己看看 http://bbs.bc-cn.net/bbs/dispbbs.asp?boardID=10&ID=18432&page=1

2005-05-17 13:30



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-18474-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 1.105831 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved