asp如何实现文章例表上一篇下一篇标题形式出现的,求帮助
<%pid1=rs("n_id")
function Getpre
sql="select top 1 * from news where id>"&pid1&" order by n_id"
set rs=conn.execute(sql)
if rs.eof or rs.bof then
response.Write("没有新闻了")
else
pid2=rs("n_id")
response.Write("<a href='news.asp?id="&pid2&"'>"&rs("n_title")&"</a>")
end if
end function
function Getnext
sql="select top 1 * from news where id<"&pid1&" order by n_id desc"
set rs=conn.execute(sql)
if rs.eof then
response.Write("没有新闻了")
else
pid3=rs("n_id")
response.Write("<a href='news.asp?id="&pid3&"'>"&rs("n_title")&"</a>")
end if
end function
%>
上一篇:<% Getpre %>
下一篇:<% Getnext %>
access数据库列表为