龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > web编程 > asp编程 >

不用组件的简单分页

时间:2012-12-31 22:56来源:未知 作者:admin 点击:
分享到:
set conn=server.CreateObject(adodb.connection) set rs=server.CreateObject(adodb.recordset) cnpath=data source= server.MapPath(question.mdb) conn.open provider=microsoft.jet.oledb.4.0; cnpath rs.open bbs,conn,3,3 set rs=conn.execute(select *
set conn=server.CreateObject("adodb.connection") set rs=server.CreateObject("adodb.recordset") cnpath="data source=" & server.MapPath("question.mdb") conn.open "provider=microsoft.jet.oledb.4.0;" & cnpath rs.open "bbs",conn,3,3 set rs=conn.execute("select * From mytable") do until rs.eoftatalrecord=tatalrecord+1rs.movenextloopnum=tatalrecord Mod 15if num>0 theni=1elsei=0end iftatalpage=int(tatalrecord/15+i)rs.movefirstpage=request.querystring("page")
if page="" thenpage=1end if if not rs.eof then if page=1 then rs.movefirst else
rs.move((page-1)*15)
end if for iPage=1 to 15 if rs.eof then exit for
response.end end if rs("xxxxx")
rs.movenext next end if
if page=1 then %> <a href="bbs.asp?page=<%=page+1%>">下一页</a> <a href="bbs.asp?page=<%=tatalpage%>">尾页</a> <% elseif int(page)=int(tatalpage) then %> <a href="bbs.asp?page=1">首页</a> <a href="bbs.asp?page=<%=page-1%>">上一页</a> <%else %> <a href="bbs.asp?page=1">首页</a> <a href="bbs.asp?page=<%=page-1%>">上一页</a> <a href="bbs.asp?page=<%=page+1%>">下一页</a> <a href="bbs.asp?page=<%=tatalpage%>">尾页</a> <% end if %> 共<b><%=tatalrecord%></b>条记录&nbsp;第<b><%=page%>/<%=tatalpage%></b>页&nbsp;每页<b>15</b>条记录
<form action="bbs.asp" style="position: relative"> <p align="right"> 跳转到第<input type="text" name="page" size="4">页<input type="submit" value="确定" name="B1" style="border-style: solid"> </form>

精彩图集

赞助商链接