关于文章浏览里的上一条和下一条的实现方法

<a href="content.asp?pev=<%=rs("id")%>">上一条</a> <a href="content.asp?last=<%=rs("id")%>">下一条</a>

If pev="" And last="" then
      sql
="select * from informains where chk='1' and id=" & CInt(id)
    
Else 
        
If pev<>"" Then
        sql
="select top 1 * from informains where chk='1' and id<" & CInt(pev) & " order by id desc"
        
End If
        
If last<>"" Then
        sql
="select top 1 * from informains where chk='1' and id>" & CInt(last)
        
End if
    
End If

注意看上面的SQL语句!
posted @ 2006-02-20 13:18  Aowind  阅读(1413)  评论(0编辑  收藏  举报