<participant>
	<insertText location="aboveHTML+30"><![CDATA[<%
// *** Delete Record: construct a sql delete statement and execute it

if (String(Request("MM_delete")) == "@@formName@@" &&
    String(Request("MM_recordId")) != "undefined") {

  if (!MM_abortEdit) {
    // execute the delete
    var MM_editCmd = Server.CreateObject ("ADODB.Command");
    MM_editCmd.ActiveConnection = MM_@@cname@@_STRING;
    MM_editCmd.CommandText = "DELETE FROM @@table@@ WHERE @@escapedCol@@ = ?"
    MM_editCmd.Prepared = true;
    <@ loop(@@paramName@@, @@paramType@@, @@paramDirection@@, @@paramSize@@, @@paramValue@@, @@paramTypeDisplayName@@) @>MM_editCmd.Parameters.Append(MM_editCmd.CreateParameter("@@paramName@@", @@paramType@@, @@paramDirection@@, @@paramSize@@, @@paramValue@@)); // @@paramTypeDisplayName@@
    <@ endloop @>MM_editCmd.Execute();
    MM_editCmd.ActiveConnection.Close();<@ if (@@redirect__url@@) @>

    // append the query string to the redirect URL
    var MM_editRedirectUrl = "@@redirect__url@@";
    if (MM_editRedirectUrl && Request.QueryString && Request.QueryString.Count > 0) {
      MM_editRedirectUrl += ((MM_editRedirectUrl.indexOf('?') == -1) ? "?" : "&") + Request.QueryString;
    }
    Response.Redirect(MM_editRedirectUrl)<@ endif @>
  }
}
%>]]></insertText>
	<searchPatterns whereToSearch="directive">
		<searchPattern paramNames="formName,cname,table,escapedCol,MM_loop1,redirect__url" isOptional="false" limitSearch="all"><![CDATA[/\/\/ \*\*\* Delete Record: construct a sql delete statement and execute it(?:\r\n|\r(?!\n)|\n)[ \t]*(?:\r\n|\r(?!\n)|\n)[ \t]*if \(String\(Request\("MM_delete"\)\) == "([^\r\n]*?)" &&(?:\r\n|\r(?!\n)|\n)[ \t]*String\(Request\("MM_recordId"\)\) != "undefined"\) \{(?:\r\n|\r(?!\n)|\n)[ \t]*(?:\r\n|\r(?!\n)|\n)[ \t]*if \(!MM_abortEdit\) \{(?:\r\n|\r(?!\n)|\n)[ \t]*\/\/ execute the delete(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_editCmd = Server\.CreateObject \("ADODB\.Command"\);(?:\r\n|\r(?!\n)|\n)[ \t]*MM_editCmd\.ActiveConnection = MM_([^\r\n]*?)_STRING;(?:\r\n|\r(?!\n)|\n)[ \t]*MM_editCmd\.CommandText = "DELETE FROM ([^\r\n]*?) WHERE ([^\r\n]*?) = \?"(?:\r\n|\r(?!\n)|\n)[ \t]*MM_editCmd\.Prepared = true;(?:\r\n|\r(?!\n)|\n)[ \t]*((?:MM_editCmd\.Parameters\.Append\(MM_editCmd\.CreateParameter\("[^\r\n]*", [^\r\n]*, [^\r\n]*, [^\r\n]*, [^\r\n]*\)\);(?:\s*\/\/[^\r\n]*)?(?:\r\n|\r(?!\n)|\n)[ \t]*)*?)MM_editCmd\.Execute\(\);(?:\r\n|\r(?!\n)|\n)[ \t]*MM_editCmd\.ActiveConnection\.Close\(\);(?:(?:\r\n|\r(?!\n)|\n)[ \t]*(?:\r\n|\r(?!\n)|\n)[ \t]*\/\/ append the query string to the redirect URL(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_editRedirectUrl = "([^\r\n]*?)";(?:\r\n|\r(?!\n)|\n)[ \t]*if \(MM_editRedirectUrl && Request\.QueryString && Request\.QueryString\.Count >\s*0\) \{(?:\r\n|\r(?!\n)|\n)[ \t]*MM_editRedirectUrl \+= \(\(MM_editRedirectUrl\.indexOf\('\?'\) == -1\) \? "\?" : "&"\) \+ Request\.QueryString;(?:\r\n|\r(?!\n)|\n)[ \t]*\}(?:\r\n|\r(?!\n)|\n)[ \t]*Response\.Redirect\(MM_editRedirectUrl\))?(?:\r\n|\r(?!\n)|\n)[ \t]*\}(?:\r\n|\r(?!\n)|\n)[ \t]*\}(?=\r\n|\r|\n|%>)/i]]></searchPattern>
		<searchPattern paramNames="paramName,paramType,paramDirection,paramSize,paramValue" limitSearch="@@MM_loop1@@" isOptional="true" searchType="multiple"><![CDATA[/MM_editCmd\.Parameters\.Append\(MM_editCmd\.CreateParameter\("([^\r\n]*?)", ([^\r\n]*?), ([^\r\n]*?), ([^\r\n]*?), ([^\r\n]*?)\)\);(?:\s*\/\/[^\r\n]*)?(?:\r\n|\r(?!\n)|\n)[ \t]*/i]]></searchPattern>
	</searchPatterns>
	<quickSearch>MM_editCmd.ActiveConnection.Close();</quickSearch>
</participant>

<!-- participant modified by hand: we should not match the ending of the CreateParameter lines -->
