<%=Application("titles")%>
<%
Dim TotalPages '总记录数
Dim CurrentPage
Dim MaxPerPage '每页记录数
MaxPerPage =12
page = Request.QueryString("Page")
dim key
key=trim(request("key"))
set rs=server.createobject("adodb.recordset")
sql="SELECT cxn,id,pic,hits from down where cxn like '%"&key&"%' order by date desc"
'response.write sql
rs.open sql,conn,1,1
%>
<%
totalPut = rs.recordcount//总页数
rs.pagesize = MaxPerPage
CurrentPage = 0
If Trim(page) <> "" then
CurrentPage = CLng(request("page"))
If CurrentPage > rs.PageCount then
CurrentPage = rs.PageCount
End If
Else
CurrentPage = 1
End If
if not rs.eof then
rs.MoveFirst
totalPut = rs.recordcount
if CurrentPage<>1 then
if (CurrentPage - 1)*MaxPerPage < totalPut then
rs.move(CurrentPage - 1)*MaxPerPage
end if
end if
dim n,k
if (totalPut mod MaxPerPage)=0 then
n = totalPut \ MaxPerPage
else
n = totalPut \ MaxPerPage + 1
end if
end if
i = 0
'---------------------分页中部数字分页----------------------
Dim x
Dim Num,sb
Num=""
Num=10 '显示页数
CurrentIndex=(page\num)
if CurrentIndex=0 then
BeginPage=1
EndPage=Num
else
BeginPage=(-1)
EndPage=Num
end if
'------------------------------------------------------
'分页显示过程
sub pageshow()
if CurrentPage>1 then
Response.write " "
Response.write " "
else
Response.write ""
Response.write ""
end if
p=""
For p = BeginPage to EndPage
if CurrentIndex*num +p > n then exit for
Response.Write ""
if page-1=(CurrentIndex*Num+p-1) then
Response.Write "" & CurrentIndex*num +p & ""
else
Response.Write "" & CurrentIndex*num +p & ""
end if
Response.Write " | "
Next
if CurrentPage"
Response.write ""
Response.write ""
Response.write ""
else
Response.write ""
Response.write ""
end if
Response.write ""
end sub
//分页显示过程结束
%>