Function GetPre(pid,prame,ptable) id = prame&"_id" title = prame&"_title" table = "city_"&ptable url = "show_"&ptable sql = "Select TOP 1 "&id&","&title&" FROM "&table&" Where "&id&"<"&pid&" orDER BY "&id&" DESC" set rs = Conn.Execute(sql) If rs.eof or rs.bof Then pre = "上一篇:没有新闻了" Else pre = "<a href="&url&".asp?"&id&"="&rs(0)&">"&rs(1)&"</a>" End If GetPre = pre End Function
Rem = 下一篇 Rem============= Rem= 参数函意和上过程一样 Rem========== Function GetNext(nid,nrame,ntable) id = nrame&"_id" title = nrame&"_title" table = "city_"&ntable url = "show_"&ntable sql = "Select TOP 1 "&id&","&title&" FROM "&table&" Where "&id&">"&nid&" orDER BY "&id&" " set rs = Conn.Execute(sql) If rs.eof or rs.bof Then nnext = "下一篇:没有新闻了" Else nnext = "<a href="&url&".asp?"&id&"="&rs(0)&">下一篇:"&rs(1)&"</a>" End If GetNext = nnext End Function