<participant>
	<insertText location="aboveHTML+18"><![CDATA[<%
// *** Redirect if username exists
var MM_flag = "MM_insert";
if (String(Request(MM_flag)) != "undefined") {
  var MM_dupKeyRedirect = "@@dupKeyRedirect@@";
  var MM_dupKeyUsernameValue = String(Request.Form("@@frmUsername@@"));
  var MM_rsKey_cmd = Server.CreateObject ("ADODB.Command");
  MM_rsKey_cmd.ActiveConnection = MM_@@connName@@_STRING;
  MM_rsKey_cmd.CommandText = "SELECT @@fldUsername@@ FROM @@tableName@@ WHERE @@fldUsername@@ = ?";
  MM_rsKey_cmd.Prepared = true;
  MM_rsKey_cmd.Parameters.Append(MM_rsKey_cmd.CreateParameter("param1", @@paramType@@, 1, @@paramSize@@, MM_dupKeyUsernameValue)); // @@paramTypeDisplayName@@
  var MM_rsKey = MM_rsKey_cmd.Execute();
  if (!MM_rsKey.EOF || !MM_rsKey.BOF) {
    // the username was found - can not add the requested username
    var MM_qsChar = "?";
    if (MM_dupKeyRedirect.indexOf("?") >= 0) MM_qsChar = "&";
    MM_dupKeyRedirect = MM_dupKeyRedirect + MM_qsChar + "requsername=" + MM_dupKeyUsernameValue;
    Response.Redirect(MM_dupKeyRedirect);
  }
  MM_rsKey.Close();
}
%>]]></insertText>
	<searchPatterns whereToSearch="directive">
		<searchPattern paramNames="dupKeyRedirect,frmUsername,connName,fldUsername,tableName,paramType,paramSize" isOptional="false" limitSearch="all"><![CDATA[/\/\/ \*\*\* Redirect if username exists(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_flag = "MM_insert";(?:\r\n|\r(?!\n)|\n)[ \t]*if \(String\(Request\(MM_flag\)\) != "undefined"\) \{(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_dupKeyRedirect = "([^\r\n]*?)";(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_dupKeyUsernameValue = String\(Request\.Form\("([^\r\n]*?)"\)\);(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_rsKey_cmd = Server\.CreateObject \("ADODB\.Command"\);(?:\r\n|\r(?!\n)|\n)[ \t]*MM_rsKey_cmd\.ActiveConnection = MM_([^\r\n]*?)_STRING;(?:\r\n|\r(?!\n)|\n)[ \t]*MM_rsKey_cmd\.CommandText = "SELECT ([^\r\n]*?) FROM ([^\r\n]*?) WHERE [^\r\n]*? = \?";(?:\r\n|\r(?!\n)|\n)[ \t]*MM_rsKey_cmd\.Prepared = true;(?:\r\n|\r(?!\n)|\n)[ \t]*MM_rsKey_cmd\.Parameters\.Append\(MM_rsKey_cmd\.CreateParameter\("param1", ([^\r\n]*?), 1, ([^\r\n]*?), MM_dupKeyUsernameValue\)\);(?:\s*\/\/[^\r\n]*)?(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_rsKey = MM_rsKey_cmd\.Execute\(\);(?:\r\n|\r(?!\n)|\n)[ \t]*if \(!MM_rsKey\.EOF \|\| !MM_rsKey\.BOF\) \{(?:\r\n|\r(?!\n)|\n)[ \t]*\/\/ the username was found - can not add the requested username(?:\r\n|\r(?!\n)|\n)[ \t]*var MM_qsChar = "\?";(?:\r\n|\r(?!\n)|\n)[ \t]*if \(MM_dupKeyRedirect\.indexOf\("\?"\) >\s*= 0\) MM_qsChar = "&";(?:\r\n|\r(?!\n)|\n)[ \t]*MM_dupKeyRedirect = MM_dupKeyRedirect \+ MM_qsChar \+ "requsername=" \+ MM_dupKeyUsernameValue;(?:\r\n|\r(?!\n)|\n)[ \t]*Response\.Redirect\(MM_dupKeyRedirect\);(?:\r\n|\r(?!\n)|\n)[ \t]*\}(?:\r\n|\r(?!\n)|\n)[ \t]*MM_rsKey\.Close\(\);(?:\r\n|\r(?!\n)|\n)[ \t]*\}(?=\r\n|\r|\n|%>)/i]]></searchPattern>
	</searchPatterns>
	<quickSearch>MM_rsKey_cmd.Parameters.Append(MM_rsKey_cmd.CreateParameter("param1",</quickSearch>
</participant>

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