一个简单的bbs(五)

发表于:2007-06-30来源:作者:点击数: 标签:
显示页面disp.asp: % Set connection = Server.CreateObject(ADODB.Connection) DBPath = Server.MapPath(bbs.mdb) connection.Open driver={Microsoft Access Driver (*.mdb)};dbq= quot;SELECT * FROM bbs WHERE ID=topnum ORDER BY ID DESC) Set conn = Se
显示页面disp.asp:

<% Set connection = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("bbs.mdb")
connection.Open "driver={Microsoft Aclearcase/" target="_blank" >ccess Driver (*.mdb)};dbq=" & DBPath
set RS=Connection.Execute("SELECT * FROM bbs WHERE ID=topnum ORDER BY ID DESC")
Set conn = Server.CreateObject("ADODB.Connection")
DBPath = Server.MapPath("bbs.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
Do While not RS.EOF %>
<% =RS("id") %>
<a href="detail.asp?ID=<% =RS("id") %>"><% =RS("subject") %></a>
<FONT SIZE="4"><B><% =RS("authorname") %></B></FONT>
<%=RS("adddate") &" " %>
<% =RS("addtime") %>(<% =RS("visitnum") %>)<p>
<% Set RSNEXT=Conn.Execute("SELECT * FROM bbs  WHERE topnum<>ID and Cstr(topnum)="&rs("id")&" ORDER BY ID ASC")
Do While Not RSNEXT.EOF %>

<% =RSNEXT(0) %>
<a href="detail.asp?ID=<% =RSNEXT(0) %>">Re<% =RSNEXT(6) %>:<% =RSNEXT(2) %></a>
<FONT SIZE="4"><B><% =RSNEXT(1) %></B></FONT> <% =RSNEXT(4) &" " %><% =RSNEXT(7) %>(<% =RSNEXT(5) %>)<P>
<% RSNEXT.MoveNext
Loop
RS.MoveNext
Loop
rsnext.Close
Conn.Close
RS.Close
Connection.Close %>
</body>
</html>

原文转自:http://www.ltesting.net