28,391
社区成员
发帖
与我相关
我的任务
分享
<%
id = TRIM(request("id"))
if not isnumeric(id) then
response.write "参数错误!"
response.End()
end if
sql = "select top 1 id,title from news where id<" & id & " order by id desc"
SET rs = conn.EXECUTE(sql)
if rs.eof and rs.bof then
prevStr = "没有了"
else
prevStr = "<a href='?id=" & rs("id") & "'>" & rs("Title") & "</a>"
end if
rs.close
sql = "select top 1 id,title from news where id>" & id & " order by id"
SET rs = conn.EXECUTE(sql)
if rs.eof and rs.bof then
nextStr = "没有了"
else
nextStr = "<a href='?id=" & rs("id") & "'>" & rs("Title") & "</a>"
end if
rs.close
set rs=nothing
Dim tempStr : tempStr = "<TABLE WIDTH=""800"" BORDER=""0"" ALIGN=""CENTER"" CELLPADDING=""0"" CELLSPACING=""0"">"
tempStr = tempStr & "<TR><TD HEIGHT=""20"" align=left>上一篇文章:"
tempStr = tempStr & prevStr
tempStr = tempStr & "</TD></TR>"
tempStr = tempStr & "<TR><TD HEIGHT=""20""align=left>下一篇文章:"
tempStr = tempStr & nextStr
tempStr = tempStr & "</TD></TR>"
tempStr = tempStr & "</TABLE>"&vbCrLf
response.write tempStr
%>