<% '定义显示页面的过程 Sub DispPage(RSobj,Page) RSobj.AbsolutePage = Page response.write "" for iPage=1 to RSobj.PageSize Ndate=RSobj("发布时间") Ntitle=RSobj("标题") NID=RSobj("ID") Ntitle="" & Ntitle & "" %> <% '移动指针到下一条记录 RSobj.MoveNext if RSobj.Eof then exit for next response.write "
<% =Ndate %><% =Ntitle %>
" end sub set con=server.CreateObject("ADODB.CONNECTION") Dbpath=server.MapPath("../Access_pevirc/mdb_perec_eec_xjtu.mdb") con.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & Dbpath set RSobj=server.CreateObject("ADODB.Recordset") sql="Select * from 消息 order by ID DESC" RSobj.open sql,con,3,3 '分页处理 RecNum=RSobj.recordCount pSize=20 RSobj.pagesize=pSize page=request("page") if (Not IsNumeric(page)) then page=1 else page=CLng(request("Page")) if page<1 then page=1 if page>RSobj.pagecount then page=RSobj.pagecount end if DispPage RSobj,page display '显示页数处理过程 Sub display %>
   Page:<% =page %>/<% =RSobj.pagecount %> <% '浏览页处理 response.Write("首页 ") response.Write("前页 ") response.Write("后页 ") response.Write("末页") %>
<% end sub %> <% RSobj.close set RSobj=nothing con.close set con=nothing %>