[此贴子已经被作者于2007-8-14 15:16:24编辑过]
<%id=request("id")
if id="" then
response.write"<script>alert('操作出错,下面是产生错误的可能原因:\n\n ·请选择相关参数');history.go(-1);</script>"
response.end
end if
Dim NextId PrvId
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
NextID=getNextID(rs)
rs.MovePrevious
PrvID=getPreviousID(rs)
%>
<%id=request("id")
if id="" then
response.write"<script>alert('操作出错,下面是产生错误的可能原因:\n\n ·请选择相关参数');history.go(-1);</script>"
response.end
end if
Dim NextId PrvId
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
NextID=getNextID(rs)
rs.MovePrevious
PrvID=getPreviousID(rs)
%>
<%id=request("id")
if id="" then
response.write"<script>alert('操作出错,下面是产生错误的可能原因:\n\n ·请选择相关参数');history.go(-1);</script>"
response.end
end if
Dim NextId PrvId
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
NextID=getNextID(rs)
rs.MovePrevious
PrvID=getPreviousID(rs)
%>
<%id=request("id")
if id="" then
response.write"<script>alert('操作出错,下面是产生错误的可能原因:\n\n ·请选择相关参数');history.go(-1);</script>"
response.end
end if
Dim NextId PrvId
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
NextID=getNextID(rs)
rs.MovePrevious
PrvID=getPreviousID(rs)
%>
<a href="b.asp?id=<%=NextID(rs)%>">上一条</a>
<a href="b.asp?id=<%=PrvID(rs)%>">下一条</a>
这样试试。