|
<%
dim sql
sql = "select * from news where class1= '"& trim(class1) & "' order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open SQL,conn,1,1
rs.MoveFirst
rs.pagesize=MaxPerPage
howmanyfields=rs.Fields.Count-1
const MaxPerPage=10 '每页数
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
If trim(Request("Page"))<>"" then
CurrentPage= CLng(request("Page"))
If CurrentPage> rs.PageCount then
CurrentPage = rs.PageCount
End If
Else
CurrentPage= 1
End If
if rs.eof then
response.write " 暂时没有相关新闻! "
else
totalPut=rs.recordcount
if CurrentPage<>1 then
if (currentPage-1)*MaxPerPage
|