<% option explicit
if session("login")<>"yes" then
response.write "此页面只限版主使用。"
response.End()
end if
%>
<!--#Include file="conn.asp"-->
<!DOCTYPE HTML PUBLTC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新闻管理</title>
</head>
<body>
<h2 align="center">新闻管理</h2>
<a href="add_article.asp">添加新闻</a>
<table width="90%" border="1" align="center" cellpadding="0" cellapacing="0">
<tr>
<td width="69%" align="center">新闻标题</td>
<td width="17%" align="center">管理功能</td>
<td width="14%" align="center">添加时间</td>
</tr>
<%
Dim Sql,page,n
page=clng(request.QueryString("page"))
Sql="select * From article Order By id desc"
rs.open sql,conn,1,1
If rs.Bof And rs.Eof Then
response.Write("没有任何新闻。")
response.End()
end if
n=10
rs.pagesize=n
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
rs.absolutepage=page
Do While Not rs.Eof and n>0
%>
<tr>
<td><a href=detail.asp?id=<%=rs("id")%> target="_blank"><%=rs("title")
%></a></td>
<td align="center"><a href="edit_article.asp?id=<%=rs("id")%>">修改
</a>
<a href="del_article.asp?id=<%=rs("id")%>">删除</a>
</td>
<td><%=rs("inserttime")%></td>
</tr>
<%
rs.MoveNext
n=n-1
Loop
rs.Close
conn.Close
set rs=nothing
set conn=nothing
%>
</table>
<div align="center"><a href=list_article.asp?page=<%=page-1%>>上一页</a>
<a href=list_article.asp?page=<%=page+1%>>下一页</a>
</div>
<p> </P>
</body>
</html>
參考答案:Dim Sql,page,n
page=clng(request.QueryString("page"))
Set rs = Server.CreateObject("ADODB.RecordSet")
Sql="select * From article Order By id desc"
rs.open sql,conn,1,1