<% if session("access")="ok" then ids = 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 main Where id=" & ids & " " rs.open sql,conn,1,3 num = rs("titleid") //判定是否有主題 if rs.BOF then //假如無主題的顯示結果 response.redirect "msg.asp?msg=9" //無主題顯示結束,停止ASP解析 response.end end if //有此主題的執行動作 rs.delete 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=" & num & " " rs.open sql,conn,1,3 //檢驗是否還有此主題的文章 if rs.BOF then rs.close conn.close //如果沒有則刪除該主題 DATAS = server.mappath("sql/dismdb.mdb") set conns = server.createobject("adodb.connection") conns.open "Driver={Microsoft Access Driver (*.mdb)};dbq=" & DATAS & ";" set rss = server.CreateObject("ADODB.RecordSet") sql = "Select * from title Where id=" & num & " " rss.open sql,conns,1,3 rss.delete rss.update rss.close conns.close //刪除該主題的顯示 %>

..::刪除完成::..


刪除完成,因為此主題沒有其他文章了,所以主題已經刪除。

八秒後自動回到首頁或按此回到首頁

<% //刪除該主題的顯示結束,停止解析ASP response.end end if //減少篇幅數一筆 DATAS = server.mappath("sql/dismdb.mdb") set conns = server.createobject("adodb.connection") conns.open "Driver={Microsoft Access Driver (*.mdb)};dbq=" & DATAS & ";" set rss = server.CreateObject("ADODB.RecordSet") sql = "Select * from title Where id=" & num & " " rss.open sql,conns,1,3 wp =rss("wp")-1 rss("wp") = wp rss.update rss.close conns.close //刪除單一回覆的顯示 %>

..::刪除完成::..


刪除完成

八秒後自動回到首頁或按此回到首頁

<% response.end end if response.redirect "login.html" response.end %>