呵呵,终于做出来了,给大家分享下,
<%
function up(tid)
dim rs1,sql1
sql1="select * from product where cid=1 and id > "&tid&""
set rs1 = conn.execute(sql1)
if rs1.eof then
response.write"<font size='2'>上一篇没有了</font>"
else
up_id = rs1("id")
response.write"<a href='showpp.asp?tid="&up_id&"'>"&rs1("title")&"</a>"
end if
rs1.close
set rs1 = nothing
end function
function down(tid)
dim rs2,sql2
sql2="select * from product where cid=1 and id < "&tid&""
set rs2 = conn.execute(sql2)
if rs2.eof then
response.write"<font size='2'>下一篇没有了</font>"
else
down_id = rs2("id")
response.write"<a href='showpp.asp?tid="&down_id&"'>"&rs2("title")&"</a>"
end if
rs2.close
set rs2 = nothing
end function
%>