<% 
'*******************************************************
'过程名:ShowPage
'显示“上一页,下一页”等信息
'参数:sDesURL -----链接地址,可以是一个文件名,也可以是一个有一些参数的URL
'       nTotalNumber ----- 总数量  
'       nMaxPerPage  ----- 每页数量 
'      nCurrentPage ----- 当前页   
'       bShowTotal   ----- 是否显示总数量 
'       bShowCombo   ----- 是否用下拉列表显示所有页面以提供跳转
'       sUnit        ----- 计数单位
'*******************************************************
sub ShowPage(sDesURL,nTotalNumber,nMaxPerPage,nCurrentPage,bShowTotal,bShowCombo,sUnit)
    dim n,i,strTemp,strUrl
    '计算页数
    if nTotalNumber mod nMaxPerPage=0 then  
       n= nTotalNumber \ nMaxPerPage             
    else
       n= nTotalNumber \ nMaxPerPage +1        
    end if
    '判断当前页(nCurrentPage)
    if nCurrentPage < 1 then                 
       nCurrentPage = 1    
    elseif nCurrentPage > n then                 
       nCurrentPage = n    
    end if

    strTemp = "<table  align='center' border='1' cellpadding='1' cellspacing='1'>"&_
       "<form name='ShowPages' method='post' action='&sDesURL&'><tr><td>"
        
    if bShowTotal =true then 
        strTemp= strTemp & "共收录<b>" &nTotalNumber& "</b>"& sUnit &"信息&nbsp;&nbsp;"
    end if
    '根据输入的sDesURL向它加入"?"或者"&"
    strUrl=PasteURL(sDesURL)
    if nCurrentPage < 2 then      
        strTemp=strTemp & "首页 上一页&nbsp;"
    else 
        strTemp=strTemp & "<a href='"&strUrl&"page=1'>首页</a>&nbsp;"
        strTemp=strTemp & "<a href='"&strUrl&"page="&(nCurrentPage-1)&"'>上一页</a>&nbsp;"
    end if 
    
    if n-nCurrentPage<1 then  
        strTemp=strTemp & "下一页 页尾"
    else 
        strTemp=strTemp & "<a href='"&strUrl&"page="&(nCurrentPage+1)&"'>下一页</a>&nbsp;"  
        strTemp=strTemp & "<a href='"&strUrl&"page=" & n & "'>尾页</a>&nbsp;"    
    end if 
    
    strTemp=strTemp & "&nbsp;页次:<strong><font color=red>"& nCurrentPage &"</font>/"& n &"</strong>页"  
    strTemp=strTemp & "&nbsp;<b>"& nMaxPerPage &"</b>"&sUnit&"/页"  
    
    strTemp= strTemp& "</td></tr></form></table>"
    response.Write(strTemp)
end sub  
 
'*******************************************************************
'函数名:PasteURL
'作  用:向地址中加入"?"或"&"
'参  数:strUrl  -----网址
'返回值:加入了"?"或"&"的网址
'*******************************************************************
function PasteURL(strUrl)
    if strUrl="" then 
        PasteURL=""
        exit function
    end if 
    
    '如果传入的URL末尾不是"?"有两种情况:
    '1.无"?",此时需要加入一个"?"
    '2.有"?",再判断有无"&"
    if InStr(strUrl,"?")< len(strUrl) then
        if Instr(strUrl,"?")>1 then 
            if Instr(strUrl,"&")<len(strUrl) then
                PasteURL=strUrl & "&"
            else
                PasteURL=strUrl
            end if 
        else
            PasteURL=strUrl & "?"
        end if
    else
        PasteURL=strUrl
    end if
end function    
%>

  这段代码摘自一ASP书上,上述该模块在使用时用include包含进去,不做任何修改即可使用ShowPage函数实现分页功能。小弟将些保存在a.asp中,在b.asp中包含进来使用时<%  Call ShowPage("b.asp",3,1,1,true,0,"条") %> 调用,却无法预计效果,改成<% Call ShowPage(Request.ServerVariables("SCRIPT_NAME"),rs_ground.RecordCount,2,Request("Page"),true,0,"条")%> 结果。。
  在些诚请名位仁兄,仁姐,高手们能指点一二,不胜感激!~~