%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%> <% // *** Edit Operations: declare variables // set the form action variable var MM_editAction = Request.ServerVariables("SCRIPT_NAME"); if (Request.QueryString) { MM_editAction += "?" + Request.QueryString; } // boolean to abort record edit var MM_abortEdit = false; // query string to execute var MM_editQuery = ""; %> <% // *** Delete Record: declare variables if (String(Request("MM_delete")) == "form1" && String(Request("MM_recordId")) != "undefined") { var MM_editConnection = MM_MediaEdge_STRING; var MM_editTable = "Content"; var MM_editColumn = "ID"; var MM_recordId = "" + Request.Form("MM_recordId") + ""; var MM_editRedirectUrl = ""; // append the query string to the redirect URL if (MM_editRedirectUrl && Request.QueryString && Request.QueryString.Count > 0) { MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1)?"?":"&") + Request.QueryString; } } %> <% // *** Delete Record: construct a sql delete statement and execute it if (String(Request("MM_delete")) != "undefined" && String(Request("MM_recordId")) != "undefined") { // create the sql delete statement MM_editQuery = "delete from " + MM_editTable + " where " + MM_editColumn + " = " + MM_recordId; if (!MM_abortEdit) { // execute the delete var MM_editCmd = Server.CreateObject('ADODB.Command'); MM_editCmd.ActiveConnection = MM_editConnection; MM_editCmd.CommandText = MM_editQuery; MM_editCmd.Execute(); MM_editCmd.ActiveConnection.Close(); if (MM_editRedirectUrl) { Response.Redirect(MM_editRedirectUrl); } } } %> <% var deleteContent__MMColParam = "1"; if (String(Request.QueryString("ID")) != "undefined" && String(Request.QueryString("ID")) != "") { deleteContent__MMColParam = String(Request.QueryString("ID")); } %> <% var deleteContent = Server.CreateObject("ADODB.Recordset"); deleteContent.ActiveConnection = MM_MediaEdge_STRING; deleteContent.Source = "SELECT * FROM Content WHERE ID = "+ deleteContent__MMColParam.replace(/'/g, "''") + ""; deleteContent.CursorType = 0; deleteContent.CursorLocation = 2; deleteContent.LockType = 1; deleteContent.Open(); var deleteContent_numRows = 0; %>