<% //開啟主題資料庫 id = request("id") DATAS = server.mappath("sql/dismdb.mdb") set conn = server.createobject("adodb.connection") conn.open "Driver={Microsoft Access Driver (*.mdb)};dbq=" & DATAS & ";" set rs = server.CreateObject("ADODB.RecordSet") sql = "Select * from title Where id=" & id & " " rs.open sql,conn,1,3 //判定是否有主題,沒主題的顯示內容 if rs.BOF then //移至4號訊息 response.redirect "msg.asp?msg=4" response.end end if title=rs("title") //將人氣值加一 rp =rs("rp")+1 rs("rp") = rp //寫入資料 rs.update //關閉資料庫 rs.close conn.close //開啟內容資料庫 DATAS = server.mappath("sql/dismdb.mdb") set conn = server.createobject("adodb.connection") conn.open "Driver={Microsoft Access Driver (*.mdb)};dbq=" & DATAS & ";" set rs = server.CreateObject("ADODB.RecordSet") sql = "Select * from main where titleid=" & id & " order by time Desc" rs.open sql,conn,1,1 //判定主題是否有內容,沒內容的顯示內容 if rs.BOF then //移至4號訊息 response.redirect "msg.asp?msg=5" response.end end if //內容輸出 %> <%=(titlename)%>--<%=(title)%>

<%=(titlename)%>

<%=(titletext)%>


主題:<%=(title)%>
..::">回覆|新主題|首頁|管理<%if session("access")="ok" then%>|">刪除整篇主題<%end if%>::..

<% howpages = rs.recordcount //迴圈讀取內容 for n=1 to howpages main=rs("main") name=rs("name") %>
<%=(name)%>"><%=(main)%>
<%if rs("mail")=empty then%>No Mail<%else%>" title="寄信!"> <%end if%>
">引用|">回覆<%if session("access")="ok" then%>|">刪除<%end if%>
<%=rs("ip")%> <%=rs("time")%>


<% //移至下一筆 rs.movenext //當最後一筆時,離開迴圈 if rs.EOF then exit for end if next //關閉資料庫 rs.close conn.close %>

<%=(copyleft)%>