分页方法

网络整理 - 07-26

     <%
     id=request("t_id")
     
  set rs=server.createobject("adodb.recordset")
          sql="select * from news where news_type="&id&" order by news_id desc"
          rs.open sql,conn,1,1
         
        rs.pagesize=20
  currentpage=Clng(request("page"))
  if currentpagers.pagecount then currentpage=rs.pagecount
  rs.absolutepage=currentpage
  %>
  <% do while not rs.eof %>
   


    <% =rs("news_date")%>
   


   <%
   i=i+1
   rs.movenext
   if i>=rs.pagesize then exit do
   loop
   %>
  

       


           
                    


                      
                         

 总 <% =rs.recordcount%>
       条记录 每页显示 <%=rs.pagesize%> 条 第 <%=currentpage%>
                          页/共 <%=rs.pagecount%> 页        
                          <%if currentpage>1 then%>
                          
       首 页
                          
       上一页
                          <%else%>首 页 上一页 <%end if%>
                          <%if currentpage