try:
========假定当前新闻id=某值
<%
set rs=Server.CreateObject("Adodb.Recordset")
sql="Select Top 1 a.time As time,b.id As bid,c.id As cid From (news a left outer join news b on b.id<a.id) left outer join news c on c.id>a.id Where a.id="&id&" order by b.id Desc,c.id Asc"
rs.open sql,conn,1,1
  if not rs.eof then
    response.write "上一篇文章:"&rs("bid")
    response.write "下一篇文章:"&rs("cid")
  end if
rs.close
Set rs=nothing
conn.close
Set conn=nothing
%>