这是5D的一个老帖子,忘了是谁写的了,挺不错的,你也看看.
'调用方法: call paginaction(rs.pagecount,rs.pagesize,page,rs.recordcount)
function pagination(pagecount,pagesize,page,resultcount)
dim query,a,x,temp
action="http://" & request.ServerVariables("HTTP_HOST"
& request.ServerVariables("SCRIPT_NAME"
query=Split(request.servervariables("query_string"
," & "
for each x in query
a=split(x,"="
if strcomp(a(0),"page",vbTextCompre) <>0 then
temp=temp & a(0) & "=" & a(1) & "&"
end if
next
response.write("<form method=get onsubmit=""document.location='" & action & "?" & temp & "page='+this.page.value;return false;"">"
if page<=1 then
response.write("[首页][上一页]"
else
response.write("[<a href=" & action & "?" & temp & "page=1>首页</a>]"
response.write("[<a href=" & action & "?" & temp & "page=" & (page-1) & ">上一页</a>]"
end if
if page>=pagecount then
response.write("[下一页][尾页]"
else
response.write("[<a href=" & action & "?" & temp & "page=" & (page+1) & ">下一页</a>]"
response.write("[<a href=" & action & "?" & temp & "page=" & pagecount & ">尾页</a>]"
end if
response.write("[页次:<font color=red>" & page & "</font>/" & pagecount)
response.write("][共" & resultcount & "条 <font color=red>" & pagesize & "</font>条/页]"
'response.write("转到" & "<input name=page size=2 value=" & page & ">" & "页<input type=submit value=go>"
response.write("<select name=page onChange=submit();>"
for i=1 to pagecount
if i=page then
selstr=" selected"
else
selstr=" "
end if
response.write("<option value=" & i & selstr &">" & i)
next
response.write("</select>"
end function