设为首页收藏本站

新微赢技术网

 找回密码
 注册
搜索
热搜: 回贴
查看: 62|回复: 1
打印 上一主题 下一主题

求助]查询出来的信息怎么分页显示出来

[复制链接]
跳转到指定楼层
1#
发表于 2010-1-13 00:12:25 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
[我查询出来的信息,可以分页显示,但是不能换页,请各位高手知道一下,代码如下 <% 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%>
您需要登录后才可以回帖 登录 | 注册

本版积分规则

申请友链|小黑屋|最新主题|手机版|新微赢技术网 ( 苏ICP备08020429号 )  

GMT+8, 2024-11-18 19:42 , Processed in 0.141736 second(s), 9 queries , Gzip On, Memcache On.

Powered by xuexi

© 2001-2013 HaiAn.Com.Cn Inc. 寰耽

快速回复 返回顶部 返回列表