以前写过类似的,PP吧~
'显示上一篇下一篇文章
function show_next(id)
dim sql
sql="select top 1 id,title from news where id<"&id&" and isurlnews=0 order by id desc"
loaddb2(sql)
if not(rs2.eof and rs2.bof) then
response.write "上一篇:<a href=read.asp?id=" & rs2("id") & " target=_self>" & rs2("title") & "</a><br>"
else
response.write "上一篇:<font color=#999999>已经没有了</font><br>"
end if
rs2.close:set rs2=nothing
sql="select top 1 id,title from news where id>"&id&" and isurlnews=0 order by id"
loaddb2(sql)
if not(rs2.eof and rs2.bof) then
response.write "下一篇:<a href=read.asp?id=" & rs2("id") & " target=_self>" & rs2("title") & "</a><br>"
else
response.write "下一篇:<font color=#999999>已经没有了</font><br>"
end if
rs2.close:set rs2=nothing
end function