显示新闻标题列表的问题~毕业设计急需!!!!!!
想做个显示新闻标题的列表,每行标题后面有“查看”和“删除”两个选项,设置为每页显示10条但运行后发现数据表中的20条数据全显示在了第一页上,而第二页则显示的后10条数据,看了下代码也没发现什么错误,小弟菜鸟,请各位大侠指点迷津...谢谢!!!!!!!!
具体代码如下:
<tr>
<td width="538" height="370" colspan="2" align="center" valign="top">
<%
dim sql,rs
Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Driver={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("db.mdb")
set rs=server.CreateObject("adodb.recordset")
sql="select * from news order by date desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.Write"目前没有记录"
response.end
else
rs.pagesize=10
page=request.QueryString("page")
if not isnumeric(page) then page=1
if isempty(page) or cint(page)<1 then page=1
if cint(page)>rs.pagecount then page=rs.pagecount
end if
rs.absolutepage=page
%>
<%
for i=1 to rs.recordcount
%>
<table width="500" height="30" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="340" height="30" align="left" valign="middle" class="STYLE9">
<%=rs("title")%>
</td>
<td width="20" align="left" valign="middle" class="STYLE9">
</td>
<td width="70" height="30" align="center" valign="middle">
<a href="<%=rs("content")%> class=" class="STYLE9"" >查看 </a>
</td>
<td width="70" height="30" align="center" valign="middle">
<a href="admin_newsdelete.asp?id=<%=rs("id")%>" class="class="STYLE9">
删除
</a>
</td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
%>
</table>
</td>
</tr>
<tr>
<td width="538" height="50" colspan="2" align="center" valign="middle">
<p align="center">
<a href="admin_news.asp?page=1">首页</a>
<a href="admin_news.asp?page=<%=page-1%>">上一页</a>
<a href="admin_news.asp?page=<%=page+1%>">下一页</a>
<a href="admin_news.asp?page=<%=rs.pagecount%>">最后页</a>
</p>
<p align="center">现在是第<%=page%>页一共有<%=rs.pagecount%>页</p>
<%
conn.close()
%>
</td>
</tr>