[CODE_LITE]<%
sql1="select id,name from table order by datetime desc"'如果有类别的话,加上where lbid="lbid",最好前面加上,如果lbid<>空,那样是最好了
Set rs1= Server.CreateObject("ADODB.Recordset")
rs1.open sql1,con,1,1
do while not rs1.eof
if rs1("id") = rs("id") then '这里要注意一下,rs1的ID和rs的ID是同一个,但是rs的id是上面显示新闻的ID,因为这个上一条和下一条都在新闻下面吗,呵呵
exit do
end if
rs1.movenext
loop
%>
