<%
'定义一个nextrs函数来找出下一篇的ID
function nextrs
nextrsd=server.CreateObject("adodb.recordset")
sql="select top 1 * from Product where Product_id>"&request("Product_id")&" order by Product_id"
set nextrsd=conn.execute(sql)
if nextrsd.eof then
response.Write "已经是最后一个产品 "
else
id1=nextrsd("Product_id")
response.Write "
下一产品 "
end If
nextrsd.close
end function
'定义一个backrs函数来找出上一篇的ID
function backrs
backrsd=server.CreateObject("adodb.recordset")
sql="select top 1 * from Product where Product_id<"&request("Product_id")&" order by Product_id desc"
set backrsd=conn.execute(sql)
if backrsd.eof then
response.Write "已经是第一个产品"
else
id2=backrsd("Product_id")
response.Write "
上一产品"
end If
backrsd.close
end function
%>
阅读(996) | 评论(0) | 转发(0) |