我为公司做了一个许愿版
公司要求我做到按时间分页...
就是一天一个页面?
代码怎么写?
请高手帮忙!
先谢谢!!!
我粗略的写了一下 楼主你自己参考一下吧
==================================================
<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>