PageSize=100
strTop="" '定义html的文件头
strBottom="" '定义html的尾部
Set Rs=server.createobject("adodb.recordset")
Sql=" select name,age,gender from [tablename]"
Rs.open Sql,conn,1,3
if not Rs.eof then
Count=Rs.recordcount '记录数
Rs.PageSize=PageSize '每页显示新闻数
PageCount=Rs.PageCount '页数
for PageID=1 to PageCount
Rs.AbsolutePage=PageID '页数游标
loopno=PageSize
Do while not Rs.Eof and loopno>0
strBody=strBody&Rs(0)&Rs(1)&Rs(2) '把数据写进变量strBody
Rs.movenext
loopno=loopno-1
loop
'在这里用fso把strTop&strBody&strBottom写进html文件,并把文件名写进数据库
strBody="" '把strBody清空,重复循环
next
lb=lb&"<table border=""0"" width=""100%"" cellspacing=""0"" cellpadding=""0""><tr><td width=""15%"" nowrap>页次:<b>"¤tPage&"</b>/<b>"&mpage&"</b> 每页<b>"&MaxPerPage&"</b> 软件数<b>"&allshu&"</b></td><td width=""65%"" nowrap><p align=""center"">"
pageno=currentPage
if cint(pageno)>1 then
lb=lb&"<a href=../soft/"&tid&"_1.htm title=""最前页"">"
end if
lb=lb&"<font face=""Webdings"">9</font></a> "
if cint(pageno)>1 then
lb=lb&"<a href=../soft/"&tid&"_"&pageno-1&".htm title=""上一页"">"
end if
lb=lb&"<font face=""Webdings"">7</font></a>"
pp=cint(pageno)-2
if pp<1 then
pp=1
end if
for pno=pp to mpage
p=p+1
if pno*1=cint(pageno)*1 then
lb=lb&" <font color=""#FF0000"">["&pno&"]</font>"
else
lb=lb&" <a href=../soft/"&tid&"_"&pno&".htm>["&pno&"]</a>"
end if
if p>=5 then exit for
next
lb=lb&" "
if cint(pageno)< mpage then
lb=lb&"<a href=../soft/"&tid&"_"&pageno+1&".htm title=""下一页"">"
end if
lb=lb&"<font face=""Webdings"">8</font></a> "
if cint(pageno)< mpage then
lb=lb&"<a href=../soft/"&tid&"_"&mpage&".htm title=""最后页"">"
end if
lb=lb&"<font face=""Webdings"">:</font></a></p></td><td width=""18%"" nowrap><table cellpadding=""0"" cellspacing=""0"">"
lb=lb&"<form onsubmit=""window.location=this.KKK2.options[this.KKK2.selectedIndex].value; return false;"">"
lb=lb&"<tr><td nowrap>到<select name=""select"" onchange=""javascript:window.location.href=this.options[this.selectedIndex].value"">"
for i=1 to mpage
selected=""
if currentpage=i then
selected=" selected"
end if
lb=lb&"<option value=../soft/"&tid&"_"&i&".htm"&selected&">"&i&"</option>"
next
lb=lb&"</select>页</td></td></tr></form></table></td></tr></table>"