<%id=request("id")
if id="" then
response.write"<script>alert('操作出错,下面是产生错误的可能原因:\n\n ·请选择相关参数');history.go(-1);</script>"
response.end
end if
set rs=server.createobject("adodb.recordset")
sql="SELECT * FROM a where id = "&id&" ORDER BY id DESC"
rs.open sql,conn,2,3
function getNextID(rs)
rs.MoveNext
if rs.eof then
rs.MovePrevious
getNextID = rs("id")
else
getNextID = rs("id")
end if
end function
function getPreviousID(rs)
rs.MovePrevious
IF rs.BOF Then
rs.MoveNext
getPreviousID=rs("id")
Else
getPreviousID=rs("id")
end if
end function
%>
<a href="b.asp?
id=<%=getNextID(rs)%>">上一条</a>
<a href="b.asp?
id=<%=getPreviousID(rs)%>">下一条</a>
上、下条ID取到的值为什么是一样的呢?
[此贴子已经被作者于2007-8-14 15:16:24编辑过]