以下代码直接复制即可使用。
' T; z2 x4 Q4 S9 @! ~% |<%dim newsid newsid=Request("showid") 4 S$ ~; T7 \/ n
sql="select top 1 title,id from cnnew where id<"&newsid&" order by id desc" set rsnews=conn.execute(sql) if rsnews.eof then response.write "上一篇文章: 已经是首篇文章了" else response.write "上一篇文章: <a href=news-cn.asp?showid="&rsnews("id")&">"&rsnews("title")&"</a>" end if response.Write"<p>" sql="select top 1 title,id from cnnew where id>"&newsid&" order by id" set rsnews=conn.execute(sql) if rsnews.eof then response.write "下一篇文章: 请等待更新" else response.write "下一篇文章: <a href=news-cn.asp?showid="&rsnews("id")&">"&rsnews("title")&"</a>" end if
! F) ?( U& ~8 r8 ?- v ?$ u%>
7 j; f& s6 B/ V' \4 R% B1 O B
4 C$ d0 n- |; U% P9 e[此贴子已经被作者于2012-8-8 15:23:51编辑过] . [% a+ ^4 X; f5 [9 S
|