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

If (CStr(Request("MM_delete")) = "@@formName@@" And CStr(Request("MM_recordId")) <> "") Then

  If (Not MM_abortEdit) Then
    ' execute the delete
    Set MM_editCmd = Server.CreateObject ("ADODB.Command")
    MM_editCmd.ActiveConnection = MM_@@cname@@_STRING
    MM_editCmd.CommandText = "DELETE FROM @@table@@ WHERE @@escapedCol@@ = ?"
    <@ 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
    Dim MM_editRedirectUrl
    MM_editRedirectUrl = "@@redirect__url@@"
    If (Request.QueryString <> "") Then
      If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0) Then
        MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
      Else
        MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
      End If
    End If
    Response.Redirect(MM_editRedirectUrl)<@ endif @>
  End If

End If
%>]]></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 \(CStr\(Request\("MM_delete"\)\) = "([^\r\n]*?)" And CStr\(Request\("MM_recordId"\)\)\s*<>\s*""\) Then(?:\r\n|\r(?!\n)|\n)[ \t]*(?:\r\n|\r(?!\n)|\n)[ \t]*If \(Not MM_abortEdit\) Then(?:\r\n|\r(?!\n)|\n)[ \t]*' execute the delete(?:\r\n|\r(?!\n)|\n)[ \t]*Set 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\.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]*Dim MM_editRedirectUrl(?:\r\n|\r(?!\n)|\n)[ \t]*MM_editRedirectUrl = "([^\r\n]*?)"(?:\r\n|\r(?!\n)|\n)[ \t]*If \(Request\.QueryString\s*<>\s*""\) Then(?:\r\n|\r(?!\n)|\n)[ \t]*If \(InStr\(1, MM_editRedirectUrl, "\?", vbTextCompare\) = 0\) Then(?:\r\n|\r(?!\n)|\n)[ \t]*MM_editRedirectUrl = MM_editRedirectUrl & "\?" & Request\.QueryString(?:\r\n|\r(?!\n)|\n)[ \t]*Else(?:\r\n|\r(?!\n)|\n)[ \t]*MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request\.QueryString(?:\r\n|\r(?!\n)|\n)[ \t]*End If(?:\r\n|\r(?!\n)|\n)[ \t]*End If(?:\r\n|\r(?!\n)|\n)[ \t]*Response\.Redirect\(MM_editRedirectUrl\))?(?:\r\n|\r(?!\n)|\n)[ \t]*End If(?:\r\n|\r(?!\n)|\n)[ \t]*(?:\r\n|\r(?!\n)|\n)[ \t]*End If(?=\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 -->
