<% '查询数据库 SQL="select [Id],title from [表名] where id>"&接收参数&" Order By Id Asc" Set Rs=Conn.Execute(SQL) If Not rs.eof And Not rs.bof Then FirstArticle=Rs.GetRows() SQL="select [Id],title from [表名] where id<"&接收参数&" Order By Id Desc" Set Rs=Conn.Execute(SQL) If Not rs.eof And Not rs.bof Then NextArticle=Rs.GetRows() '显示上下文章 Response.Write " 上一篇:" If IsArray(FirstArticle) Then Response.Write "<a href='Article.asp?Articleid="&FirstArticle(0,0)&"'>"&FirstArticle(1,0)&"</a>" Else Response.Write "<font color=800000>已到尽头</font>" End If Response.Write "<br>" Response.Write " 下一篇:" If IsArray(NextArticle) Then Response.Write "<a href='Article.asp?Articleid="&FirstArticle(0,0)&"'>"&FirstArticle(1,0)&"</a>" Else Response.Write "<font color=800000>已到尽头</font>" End If %>
问题已经解决.呵呵。.
|
Dim Rs,PrvNextArticle '//上一篇 Set Rs=Conn.Execute("Select Top 1 ID,Title From " & affiche & " Where ID<"&接收参数&" Order By ID Desc") If Rs.EOF Or Rs.BOF Then PrvNextArticle="上一篇:没有了" Else PrvNextArticle="上一篇:<a href='dongtai.asp?ID="&Rs(0)&"'>"&Rs(1)&"</a>" End If '//下一篇 Set Rs=Conn.Execute("Select Top 1 ID,Title From " & affiche & " Where ID>"&接收参数&" Order By ID ASC") If Rs.EOF Or Rs.BOF Then PrvNextArticle=PrvNextArticle&"<br>下一篇:没有了" Else PrvNextArticle=PrvNextArticle&"<br>下一篇:<a href='dongtai.asp?ID="&Rs(0)&"'>"&Rs(1)&"</a>" End If Set Rs=Nothing 我的同学写了这样的一段代码给我。弄不懂.实现不了。接收参数那里不知道怎么写
|