获得上一篇信息
<%
sql="select top 1 [id],[标题] from [数据表名] where [id]<" & 当前文章id & " order by id desc"
set rs=conn.execute(sql) 'conn为打开数据库变量
if rs.eof then
response.write("上一篇文章:没有了<br />")
else
response.write("上一篇文章:<a href='?id=" & rs(0) & "'>" & rs(1) & "</a><br />")
end if
rs.close
set rs=nothing
%>
获得下一篇信息
<%
sql="select top 1 [id],[标题] from [数据表名] where [id]>" & 当前文章id & " order by id asc"
set rs=conn.execute(sql) 'conn为打开数据库变量
if rs.eof then
response.write("上一篇文章:没有了<br />")
else
response.write("上一篇文章:<a href='?id=" & rs(0) & "'>" & rs(1) & "</a><br />")
end if
rs.close
set rs=nothing
%>