<%@ language = "vbscript" codepage =
<%
option explicit
dim idcount
dim pages
dim pagec
dim page
dim pagenc
pagenc=
dim pagenmax
dim pagenmin
page=clng(request("page"))
dim start
dim endt
dim datafrom
datafrom="table
dim conn
dim datapath
dim sqlid
dim myself
myself = request
dim sql
dim taxis
taxis="order by id desc"
dim i
start=timer()
datapath="db
pages=
dim db
db="db
set conn = server
conn
if err
response
response
end if
sql="select count(id) as idcount from ["& datafrom &"]"
set rs=server
rs
idcount=rs("idcount")
if(idcount>
if(idcount mod pages=
pagec=int(idcount/pages)
else
pagec=int(idcount/pages)+
end if
sql="select id from ["& datafrom &"] " & taxis
set rs=server
rs
rs
if page <
if page > pagec then page = pagec
if pagec >
for i=
if rs
if(i=
sqlid=rs("id")
else
sqlid=sqlid &"
end if
rs
next
end if
%>
<!doctype html public "
<html>
<head>
<meta http
<title>快速分頁</title>
<link rel="stylesheet" href="page
</head>
<body bgcolor="#f
<table width="
<tr>
<td valign="middle"><table width="
<tr>
<td valign="top" bgcolor="#ffffff"><br> <table width="
<tr>
<td><strong><font color="#ff
</tr>
</table>
<br>
<table width="
<tr align="center" bgcolor="#
<td width="
<td width="
<td width="
<td width="
</tr>
<%
if(idcount>
sql="select [id]
set rs=server
rs
while(not rs
%>
<tr bgcolor="#ffffff">
<td align="center"><%=rs(
<td><%=rs(
<td><%=rs(
<td align="center"><%=rs(
</tr>
<%
rs
wend
%>
</table>
<br>
<table width="
<tr align="center">
<td align="left">共有<strong><font color="#ff
</tr>
</table>
<table width="
<tr align="center">
<td align="right">
<%
pagenmin=page
pagenmax=page+pagenc
if(pagenmin<
pagenmin=
end if
if(page>
response
end if
if(pagenmin>
response
end if
if(pagenmax>pagec) then
pagenmax=pagec
end if
for i = pagenmin to pagenmax
if(i=page) then
response
else
response
end if
next
if(pagenmax<pagec) then
response
end if
if(page<pagec) then
response
end if
%><script language="javascript">
<!
function gopage() {
window
}
//
</script>
轉到
<input name="page" type="text" value="<%=page%>" size="
<input type="button" name="submit" value="跳轉" ></td>
</tr>
</table>
<%
end if
%>
<br>
<table width="
<tr>
<td align="center">
<p>
<%
endt=timer()
rs
set rs=nothing
conn
set conn=nothing
%>
<%=formatnumber((endt
<p><a href="" target="_blank">STONE空間</a></p></td>
</tr>
</table>
<br></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
From:http://tw.wingwit.com/Article/program/net/201311/14255.html