当前位置: 代码迷 >> vbScript >> 关于实现查看网页上一篇 下一篇效果的有关问题
  详细解决方案

关于实现查看网页上一篇 下一篇效果的有关问题

热度:6542   发布时间:2013-02-26 00:00:00.0
关于实现查看网页上一篇 下一篇效果的问题
在文章系统中,在浏览文章的时候总能看到下部一个

上一篇:******

下一篇:******


怎么实现的 
这是我的网页源代码 ,但是提示错误(红色部分)。
 是哪里出了问题 请高手看看 谢谢
<%
  dim sql
  dim rs
  dim rstype
  dim typesql
  dim typeid,typename,classname,classid,Nclassname,Nclassid,tem
  dim title
set rs=server.createobject("adodb.recordset")
sql="update product set hits=hits+1 where productID="&request("id")
rs.open sql,conn,1,3 
  sql="select Aclass.class,ANclass.Nclass,product.title,product.classid,product.Nclassid from product,Aclass,ANclass where product.classid=Aclass.classid and product.Nclassid=ANclass.Nclassid and xs=1 and product.productID="&request("id")
  rs.open sql,conn,1,1
  if not rs.eof then
title=rs("title")
classid=rs("classid")
Nclassid=rs("Nclassid")
classname=rs("class")
Nclassname=rs("Nclass")
  end if
rs.close
%>


<% 
set rs=server.createobject("adodb.recordset") 
sql="select top 1 product * id from product where nclassid<"&nclassID&" order by id desc" 
set rs=conn.execute(sql)
if rs.eof then 
response.write "上一篇文章:没有了"
else 
response.write "上一篇文章: <a href=textview.asp?id="&rs("productid")">"&rs("title")&"</a>" 
end if
sql="select top 1 product * id from product where nclassID>"&nclassID&" order by id" 
set rs=conn.execute(sql)
if rs.eof then 
response.write "下一篇文章:没有了" 
else
response.write "下一篇文章:<a href=textview.asp?id="&rs("productid")">"&rs("title")&"</a>" 
end if
%>

------解决方案--------------------------------------------------------
response.write "上一篇文章: <a href=textview.asp?id="&rs("productid")&">"&rs("title")&" </a>" 

  相关解决方案