% Response.Expires = 0 %>
<% Set Conn = Server.CreateObject("ADODB.Connection") Set Comm = Server.CreateObject("ADODB.Command") Set RS = Server.CreateObject("ADODB.Recordset") Conn.Open Session("DSN") Set Comm.ActiveConnection = Conn RS.CursorType = adOpenStatic Set RS.Source = Comm Response.Write "Updating database..." Select Case Request.Form("action") case "add" Conn.BeginTrans Comm.CommandText = "Select IsNull(Max(LinkID)+1,1) from links" RS.Open lid = RS(0) RS.Close v = "insert into links(LinkID, BugID, FileName, OriginalName, LinkedBugID, DataString, TokenID, Type, fDeleted, Rev) VALUES(" & lid & ", " & Request.Form("bugid") & ", '', '', " & Request.Form("linkedbug") & ", '', " & Request.Form("tokenid") & ", " & Request.Form("type") & ", 0, 1)" rem Response.Write v Conn.Execute v Conn.CommitTrans case "del" v = "delete from links where LinkID=" & Request.Form("linkid") rem Response.Write v Conn.Execute v case "delattach" rem Comm.CommandText = "Select Filename from links where LinkID=" & Request.Form("linkid") rem RS.Open rem fn = RS(0) rem RS.Close v = "delete from links where LinkID=" & Request.Form("linkid") rem Response.Write v Conn.Execute v end select Conn.Close %>