<%@language="vbscript" codepage="
<%
option explicit
on error resume next
dim startime
startime=timer()
dim db
db = "provider=microsoft
set conn = server
set rs = server
conn
%>
<%
Function pagination(pagecount)
Dim wzpage
boardid = Request
If boardid =
If Len(Request
wzpage = clng(Request
Else
wzpage =
End If
If wzpage <=
pagenum = (wzpage
If wzpage mod
If wzpage >
Response
Response
Response
Response
End If
For pagenum = pagenum To pagenum +
If pagenum = wzpage Then
Response
Response
Response
Else
Response
Response
Response
End If
If pagenum >= pagecount Then Exit For
Next
If wzpage < (pagecount
Response
Response
Response
Response
End If
End Function
%>
<%
dim rssql
getstring = clng(request
if getstring =
dim wzcount
wzrep =
wzcount = conn
wzpagecount = abs(int(
wzpage = clng(request
if len(wzpage) =
%>
<html>
<head>
<title>分頁測試</title>
<meta http
<link rel="stylesheet" href="page
</head>
<body>
<table width="
<tr align="center">
<td width="
<td width="
<td width="*">內容(顯示前
<td width="
</tr>
<%
rssql = "select id
rs
rs
if rs
<tr>
<td >暫無記錄</td>
</tr>
<% else
dim i
for i =
if rs
bgColor="#FFFFFF"
if i mod
%>
<tr bgcolor="<%=bgColor%>">
<td width="
<td width="
<td width="*"><%=left(rs(
<td width="
</tr>
<%
rs
next
end if
%>
</table>
<table width="
<tr>
<td align="left" width="
<td align="right"> <%= pagination(wzpagecount)%></td>
</tr>
</table>
<table width="
<tr>
<td align="center">
<%endtime=timer()%>
本頁面執行時間
</tr>
</table>
</body>
</html>
<%
rs
set rs = nothing
conn
set conn = nothing
%>
From:http://tw.wingwit.com/Article/program/net/201311/14352.html