请教一个下
<script language="javascript">
  var conn = new ActiveXObject("ADODB.Connection");
  conn.Open("DBQ=D:\GameWang\Tm.mdb;DRIVER={Microsoft Access Driver (*.mdb)};");
  var rs = new ActiveXObject("ADODB.Recordset");   
   var sql="Select * From RR  order by icount desc";
  rs.open(sql, conn);
  表RR有1000条记录在这里怎么写数字分页(1,2,3..)的代码.
</script>

解决方案 »

  1.   

    给个简单的给你,你照着改成asp的就行了
    <html>
      <head>
        <title>JS数字分页</title>
        <meta http-equiv="content-type" content="text/html;charset=gb2312" />
        <style type="text/css">
        body
        {
         font-size:11pt;
         }
        a:hover
        {
         color:Red;
         }
        a:visited
        {
         color:Blue;
         }
        </style>
      </head>
      <body>
      <ul id="ulT">
        <li>1</li>
        <li>2</li>
        <li>3</li>
        <li>4</li>
        <li>5</li>
        <li>6</li>
        <li>7</li>
        <li>8</li>
        <li>9</li>
        <li>10</li>
        <li>11</li>
        <li>12</li>
        <li>13</li>
        <li>14</li>
        <li>15</li>
        <li>16</li>
        <li>17</li>
      </ul>
      <div id="divG"></div>
      <script type="text/javascript">
      var currentPage=1,totalPage=0,totalRecord=0,pageSize=8,numGC=5;
      function $(Id){return document.getElementById(Id)}
      function $s(o,tagName){return o.getElementsByTagName(tagName);}
      function setState(){
        var currentPage=window.currentPage-1;
        var i,li=$s($('ulT'),"li");
        var len=li.length;
        for(i=0;i<currentPage*pageSize&&i<len;i++)li[i].style.display="none";
        for(i=currentPage*pageSize;i<(currentPage*pageSize+pageSize)&&i<len;i++)li[i].style.display="block";
        for(i=currentPage*pageSize+pageSize;i<len;i++)li[i].style.display="none";
      }
      function initPageParam(){
        totalRecord=$s($('ulT'),"li").length;
        if(totalRecord%pageSize==0)totalPage=totalRecord/pageSize;
        else totalPage=Math.floor(totalRecord/pageSize)+1;
        var s=window.location.search;
        var m=/page=(\d+)/i.exec(s);
        if(m)currentPage=parseInt(m[1],10);
        if(currentPage<1)currentPage=1;
        else if(currentPage>totalPage)currentPage=totalPage;
      }
      function getNumberPage(){
        var str="";
        var start,end;
        if(currentPage%numGC==0)start=currentPage;
        else start=Math.floor(currentPage/numGC)*numGC+1;
        if(start!=1&&start==currentPage)start-=1;
        end=start+numGC;
        if(end>totalPage){
            end=totalPage+1;
            if(end-start<numGC)start=end-numGC;
            if(start<1)start=1
        }
        for(var i=start;i<end;i++)
         if(i==currentPage)str+=" <font color='red'>"+i+"</font>";
         else str+=" <a href='?page="+i+"'>"+i+"</a>";
        if(str!="")str=str.substring(1);
        str=" "+str;
        return str;
      }
      function getGuider(){
        var str="";
        if(currentPage>1)str+="<a href='?page=1'>首页</a> <a href='?page="+(currentPage-1)+"'>上一页</a>";
        else str+="<font color='#666666'>首页 上一页</font>";
        str+=getNumberPage();
        if(currentPage<totalPage)str+=" <a href='?page="+(currentPage+1)+"'>下一页</a> <a href='?page="+totalPage+"'>尾页</a>";
        else str+=" <font color='#666666'>下一页 尾页</font>";
        str+=" 总共"+totalPage+"页,总记录数为"+totalRecord+","+pageSize+"条/页";
        $('divG').innerHTML=str;
      }
      window.onload=function(){
        initPageParam();//初始化分页参数
         setState();
        getGuider();
      }  
      </script>
      </body>
    </html>
      

  2.   

    晕,都给你结果了还不会改啊你要改的是这个
    var currentPage=1,//当前页
    totalPage=0,//总页数
    totalRecord=0,//总记录数
    pageSize=8,//每页显示多少条记录
    numGC=5;//显示的数字页码的数量//==========以及initPageParam里面如何获取当前页的参数的代码