==================================================
<body>
<%
'Response.Write(date())
Dim Conn,Connstr,rs,pages
pages = Request.QueryString("page")
If pages = "" Or Not IsDate(pages) Then pages=Date()
pages = Cdate(pages)
If pages > Date() Then Pages=Date()
Set Conn = Server.CreateObject("ADODB.CONNECTION")
ConnStr = "Provider = microsoft.jet.oledb.4.0;data source = "&Server.MapPath("db1.mdb")
Conn.Open connstr
Set rs = Server.CreateObject("ADODB.RECORDSET")
rs.Open "select * from tab where pubtime like '%"&pages&"%'" ,conn,1,1
If rs.Eof Then
Response.Write("暂时没有记录!")
Else
Do While Not rs.Eof
%>
<table width="200" height="23" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="58" align="center"><%=rs("id")%></td>
<td width="142" align="center"><%=rs("pubtime")%></td>
</tr>
</table>
<%
rs.MoveNext
Loop
End If
%>x
<table width="200" height="25" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="96" align="center"><a href="?page=<%=pages+1%>">上一页</a></td>
<td width="104" align="center"><a href="?page=<%=pages-1%>">下一页</a></td>
</tr>
</table>
</body>作者: √死胖子 时间: 2010-1-6 23:25
我本来是这样的代码:怎么改?
dim rs1,sql1
Set rs1= Server.CreateObject("ADODB.recordset")
sql="select * from ccc_love where cpassed=true order by cid desc"
rs.open sql,conn,1,1
sql1="select * from config"
rs1.open sql1,conn,1,1
pages=Request("pages")
if pages="" then
pages=1
else
pages=cint(pages)
end if
if pages<1 then pages=1
rs.PageSize=100
if rs.recordcount>0 then
if pages>rs.PageCount then pages=rs.PageCount
rs.AbsolutePage=pages
end if