<%
sql="select * from gbook order by id desc"
'sql="select * from gbook where check=true order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,connstr,1,1
i=0
if rs.eof then
response.write "暂无留言!"
else
const maxperpage=15
dim currentpage
rs.pagesize=maxperpage
currentpage=request.querystring("pageid")
if currentpage="" then
currentpage=1
elseif currentpage<1 then
currentpage=1
else
currentpage=clng(currentpage)
if currentpage > rs.pagecount then
currentpage=rs.pagecount
end if
end if
if not isnumeric(currentpage) then
currentpage=1
end if
dim totalput,n
totalput=rs.recordcount
if totalput mod maxperpage=0 then
n=totalput\maxperpage
else
n=totalput\maxperpage+1
end if
if n=0 then
n=1
end if
rs.move(currentpage-1)*maxperpage
i=0
w=1
do while i< maxperpage and not rs.eof
%>