以下代码直接复制即可使用。
4 ~& u% C) B9 |5 k<%dim newsid newsid=Request("showid") * ]& p6 w2 j8 C, q2 Z, }. U4 z6 Q
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
0 z7 r* C; O' S6 d8 Z' u) [0 w%> \8 Q' Y; }0 z/ w$ z6 ~3 ?
% |' Q5 ?! b" {: M/ [3 r/ W X G2 l7 c
[此贴子已经被作者于2012-8-8 15:23:51编辑过] $ F, E- o3 [5 \& f
|