查看: 193|回复: 0

[文章教程] ASP版上一篇下一篇代码

[复制链接]
xuanxiao 发表于 2023-2-16 15:28:43 | 显示全部楼层 |阅读模式
  1. <%


  2. Sub The_Next()
  3. Dim rstArticle,strSQL
  4. Dim ID_New      
  5.    
  6.         strSQL="select top 1 id,typeid,title from article where id>"&intID&" order by id"               
  7.                   
  8.        Set rstArticle=conn.Execute(strSQL)
  9.             if rstArticle.eof then
  10.                Response.Write " <p class='tt'>下一篇:<a href='javascript:'>没有了</a></p>"
  11.             else
  12.                ID_New=rstArticle(0)
  13.                Response.Write " <p class='tt'>下一篇:<a href='?pid=53&tid="&rstArticle(1)&"&id="&ID_New&"'>"&rstArticle(2)&"</a></p>"
  14.             end if
  15. end Sub

  16. Sub The_Previous()
  17. Dim rstArticle,strSQL
  18. Dim ID_New        
  19.         strSQL="select top 1 id,typeid,title from article where id<"&intID&" order by id"
  20.                   Set rstArticle=conn.Execute(strSQL)               
  21.                    if rstArticle.eof then
  22.                Print " <p class='tt'>上一篇:<a href='javascript:'>没有了</a></p>"
  23.             else
  24.                ID_New=rstArticle("id")
  25.                           
  26.                Print  " <p class='tt'>上一篇:<a href='?pid=53&tid="&rstArticle(1)&"&id="&ID_New&"'>"&rstArticle(2)&"</a></p>"
  27.             end if
  28.                        
  29.                 rstArticle.Close()
  30.        Set rstArticle=Nothing
  31.                                   
  32. end Sub



  33. %>
复制代码

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表

在线客服

售前咨询
售后咨询
服务热线
023-58418553
微信公众号