| |
<%
dim rs
dim sql
dim row
msg_per_page = 30
set rs=server.createobject("adodb.recordset")
sql="select * from link where yanzheng='ok' order by id ASC"
rs.cursorlocation = 3
rs.pagesize = msg_per_page
rs.open sql,conn,0,1
if err.number<>0 then
response.write "database a case of crabs£º" & err.description
err.clear
else
if not (rs.eof and rs.bof) then
totalrec = RS.RecordCount
if rs.recordcount mod msg_per_page = 0 then
n = rs.recordcount\msg_per_page
else
n = rs.recordcount\msg_per_page+1
end if
currentpage = request("page")
If currentpage <> "" then
currentpage = cint(currentpage)
if currentpage < 1 then
currentpage = 1
end if
if err.number <> 0 then
err.clear
currentpage = 1
end if
else
currentpage = 1
End if
if currentpage*msg_per_page > totalrec and not((currentpage-1)*msg_per_page < totalrec)then
currentPage=1
end if
rs.absolutepage = currentpage
rowcount = rs.pagesize
while not rs.eof and rowcount>0
if therow mod 1 = 0 then
response.write("")
end if
%>
|
<%
therow=therow+1
rowcount=rowcount-1
rs.MoveNext
wend
end if
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
if therow mod 6<>0 then
for i=1 to 6-(therow mod 6)
response.write(" | ")
next
end if
%>
|
<%call listPages()%>
<%
sub listPages()
for i=0 to n\msg_per_page-1
for j=1 to msg_per_page
%>
?page=<%=i*msg_per_page+j %>">[
<% =i*msg_per_page+j %>
]
<%
next
next
EndPage = n mod msg_per_page
for j=1 to EndPage
%>
?page=<% =i*msg_per_page+j %>">[
<% =i*msg_per_page+j %>
]
<%next%>
page:<%=currentpage%> <%=msg_per_page%>site/page
web site:<%=totalrec%>
<%end sub%>
|
|
|