<%
dim db
set db=server.CreateObject("adodb.connection")
db.open "dbq="& server.MapPath("×.mdb")&";driver={microsoft access driver (*.mdb)}"
%>
分頁技術(shù):
dim page_size,page_total,page_num
page_size=10
if request("page_num")="" then
page_num=1
else
if isnumeric(request("page_num")) then
page_num=request("page_num")
else
response.Write("數(shù)據(jù)出錯!請聯(lián)系管理員!")
response.End()
end if
end if
rs.pagesize=page_size
page_total=rs.pagecount
rs.absolutepage=page_num
if cint(page_num)>cint(page_total) then
response.write"請聯(lián)系管理員"
response.end()
end if
num=page_size
do while not rs.eof and num>0
num=num-1
%>...........................
<%
dim qianyiye,houyiye
if page_total=1 then
response.Write"第1/1頁 "
else
if page_num=1 then
houyiye=page_num+1
%>
第1/<%=page_total%>頁 <a href="bgrb.asp?page_num=<%=houyiye%>">后頁</a> <a href="bgrb.asp?page_num=<%=page_total%>">末頁</a>
<%
else
if cint(page_num)=cint(page_total) then
qianyiye=page_num-1
%>
第<%=page_total%>/<%=page_total%>頁 <a href="bgrb.asp?page_num=1">首頁</a> <a href="bgrb.asp?page_num=<%=qianyiye%>">前頁</a>
<% else
qianyiye=page_num-1
houyiye=page_num+1
%>
第<%=page_num%>/<%=page_total%>頁 <a href="bgrb.asp?page_num=1">首頁</a> <a href="bgrb.asp?page_num=<%=qianyiye%>">前頁</a> <a href="bgrb.asp?page_num=<%=houyiye%>">后頁</a> <a href="bgrb.asp?page_num=<%=page_total%>">末頁</a>
<%
end if
end if
end if
%>
更多信息請查看IT技術(shù)專欄