jesus4u
Feb 14th, 2001, 08:25 AM
How do you write code to check for duplicate usernames, passwords and emails for this registration form I wrote? Right now if you use this code when I register a duplicate username or password or email it gives me this error:
Cannot open record set
Error Description: [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'UserRegistrationReclaimAmerica'. Make sure it exists and that its name is spelled correctly.
Error Number: -2147217865
Error Source: Microsoft OLE DB Provider for ODBC Drivers
What is this?
I am new to programming so be gentle.
Thanks. Code is below.
<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.
On Error Resume Next
strErrorUrl = ""
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear
Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"
Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"
fp_conn.Open Application("RA_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"
fp_rs.Open "UserRegistrationReclaimAmerica", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"
fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(8)
Dim arFormDBFields0(8)
Dim arFormValues0(8)
arFormFields0(0) = "txtEmailAddress"
arFormDBFields0(0) = "Email Address"
arFormValues0(0) = Request("txtEmailAddress")
arFormFields0(1) = "txtPassword"
arFormDBFields0(1) = "Password"
arFormValues0(1) = Request("txtPassword")
arFormFields0(2) = "txtVerifyPassword"
arFormDBFields0(2) = "VerifyPassword"
arFormValues0(2) = Request("txtVerifyPassword")
arFormFields0(3) = "txtUserName"
arFormDBFields0(3) = "UserName"
arFormValues0(3) = Request("txtUserName")
arFormFields0(4) = "txtFirstName"
arFormDBFields0(4) = "First Name"
arFormValues0(4) = Request("txtFirstName")
arFormFields0(5) = "txtMailingAddress"
arFormDBFields0(5) = "Mailing Address"
arFormValues0(5) = Request("txtMailingAddress")
arFormFields0(6) = "txtLastName"
arFormDBFields0(6) = "Last Name"
arFormValues0(6) = Request("txtLastName")
arFormFields0(7) = "txtZipCode"
arFormDBFields0(7) = "ZipCode"
arFormValues0(7) = Request("txtZipCode")
FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
If Request.ServerVariables("REMOTE_HOST") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"), "Remote_computer_name"
End If
If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"), "Browser_type"
End If
FP_SaveFieldToDB fp_rs, Now, "Timestamp"
If Request.ServerVariables("REMOTE_USER") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_USER"), "User_name1"
End If
fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"
fp_rs.Close
fp_conn.Close
FP_FormConfirmation "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"Default.asp",_
"Return to the form."
End If
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Home Page</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body>
<form method="POST" action="--WEBBOT-SELF--" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1">
<!--webbot bot="SaveDatabase" SuggestedExt="asp"
U-ASP-Include-Url="_fpclass/fpdbform.inc" S-DataConnection="RA"
S-RecordSource="UserRegistrationReclaimAmerica"
U-Database-URL="fpdb/ReclaimAmerica.mdb"
S-Builtin-Fields="HTTP_USER_AGENT REMOTE_HOST Timestamp REMOTE_USER"
S-Builtin-DBFields="Browser_type1 Remote_computer_name1 Timestamp1 User_name"
S-Form-Fields="txtEmailAddress txtPassword txtVerifyPassword txtUserName txtFirstName txtMailingAddress txtLastName txtZipCode"
S-Form-DBFields="Email\ Address Password VerifyPassword UserName First\ Name Mailing\ Address Last\ Name ZipCode"
-->
<table border="1" width="587" height="1">
<tr>
<td width="136" height="5">First Name</td>
<td width="451" height="5"><!--webbot bot="Validation"
S-Display-Name="FirstName" S-Data-Type="String" B-Allow-Letters="TRUE"
B-Value-Required="TRUE" I-Minimum-Length="1" --><input type="text" name="txtFirstName" size="20"></td>
</tr>
<tr>
<td width="136" height="1">Last Name</td>
<td width="451" height="1"><!--webbot bot="Validation"
S-Display-Name="Last Name" S-Data-Type="String" B-Allow-Letters="TRUE"
B-Value-Required="TRUE" I-Minimum-Length="1" --><input type="text" name="txtLastName" size="20"></td>
</tr>
<tr>
<td width="136" height="1">Email Address</td>
<td width="451" height="1"><!--webbot bot="Validation"
S-Display-Name="Email Address" B-Value-Required="TRUE"
I-Minimum-Length="1" I-Maximum-Length="50" --><input type="text" name="txtEmailAddress" size="20" maxlength="50"></td>
</tr>
<tr>
<td width="136" height="26">Mailing Address</td>
<td width="451" height="26"><!--webbot bot="Validation"
S-Display-Name="Mailing Address" B-Value-Required="TRUE"
I-Minimum-Length="1" I-Maximum-Length="50" --><input type="text" name="txtMailingAddress" size="20" maxlength="50"></td>
</tr>
<tr>
<td width="136" height="14">Zip Code</td>
<td width="451" height="14"><!--webbot bot="Validation"
S-Display-Name="ZipCode" S-Data-Type="String" B-Allow-Digits="TRUE"
B-Value-Required="TRUE" I-Minimum-Length="5" I-Maximum-Length="5" --><input type="text" name="txtZipCode" size="20" maxlength="5"></td>
</tr>
<tr>
<td width="136" height="1">User Name</td>
<td width="451" height="1"><!--webbot bot="Validation"
S-Display-Name="UserName" S-Data-Type="String" B-Allow-Letters="TRUE"
B-Allow-Digits="TRUE" B-Value-Required="TRUE" --><input type="text" name="txtUserName" size="20">
<table width="100%" border="1" height="134">
<tbody>
</tbody>
</table>
</td>
</tr>
<tr>
<td width="136" height="1">Password</td>
<td width="451" height="1"><!--webbot bot="Validation"
S-Display-Name="Password" S-Data-Type="String" B-Allow-Letters="TRUE"
B-Allow-Digits="TRUE" B-Value-Required="TRUE" --><input type="text" name="txtPassword" size="20"></td>
</tr>
<tr>
<td width="136" height="1">Verify Password</td>
<td width="451" height="1"><!--webbot bot="Validation"
S-Display-Name="VerifyPassword" S-Data-Type="String"
B-Allow-Letters="TRUE" B-Allow-Digits="TRUE" B-Value-Required="TRUE" --><input type="text" name="txtVerifyPassword" size="20"></td>
</tr>
<tr>
<td width="136" height="1"><input type="submit" value="Submit" name="B1"><input type="reset" value="Clear" name="B2"></td>
<td width="451" height="1"></td>
</tr>
</table>
<p> </p>
</form>
</body>
</html>
Cannot open record set
Error Description: [Microsoft][ODBC Microsoft Access Driver] The Microsoft Jet database engine cannot find the input table or query 'UserRegistrationReclaimAmerica'. Make sure it exists and that its name is spelled correctly.
Error Number: -2147217865
Error Source: Microsoft OLE DB Provider for ODBC Drivers
What is this?
I am new to programming so be gentle.
Thanks. Code is below.
<%
' FP_ASP ASP Automatically generated by a Frontpage Component. Do not Edit.
On Error Resume Next
strErrorUrl = ""
If Request.ServerVariables("REQUEST_METHOD") = "POST" Then
If Request.Form("VTI-GROUP") = "0" Then
Err.Clear
Set fp_conn = Server.CreateObject("ADODB.Connection")
FP_DumpError strErrorUrl, "Cannot create connection"
Set fp_rs = Server.CreateObject("ADODB.Recordset")
FP_DumpError strErrorUrl, "Cannot create record set"
fp_conn.Open Application("RA_ConnectionString")
FP_DumpError strErrorUrl, "Cannot open database"
fp_rs.Open "UserRegistrationReclaimAmerica", fp_conn, 1, 3, 2 ' adOpenKeySet, adLockOptimistic, adCmdTable
FP_DumpError strErrorUrl, "Cannot open record set"
fp_rs.AddNew
FP_DumpError strErrorUrl, "Cannot add new record set to the database"
Dim arFormFields0(8)
Dim arFormDBFields0(8)
Dim arFormValues0(8)
arFormFields0(0) = "txtEmailAddress"
arFormDBFields0(0) = "Email Address"
arFormValues0(0) = Request("txtEmailAddress")
arFormFields0(1) = "txtPassword"
arFormDBFields0(1) = "Password"
arFormValues0(1) = Request("txtPassword")
arFormFields0(2) = "txtVerifyPassword"
arFormDBFields0(2) = "VerifyPassword"
arFormValues0(2) = Request("txtVerifyPassword")
arFormFields0(3) = "txtUserName"
arFormDBFields0(3) = "UserName"
arFormValues0(3) = Request("txtUserName")
arFormFields0(4) = "txtFirstName"
arFormDBFields0(4) = "First Name"
arFormValues0(4) = Request("txtFirstName")
arFormFields0(5) = "txtMailingAddress"
arFormDBFields0(5) = "Mailing Address"
arFormValues0(5) = Request("txtMailingAddress")
arFormFields0(6) = "txtLastName"
arFormDBFields0(6) = "Last Name"
arFormValues0(6) = Request("txtLastName")
arFormFields0(7) = "txtZipCode"
arFormDBFields0(7) = "ZipCode"
arFormValues0(7) = Request("txtZipCode")
FP_SaveFormFields fp_rs, arFormFields0, arFormDBFields0
If Request.ServerVariables("REMOTE_HOST") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_HOST"), "Remote_computer_name"
End If
If Request.ServerVariables("HTTP_USER_AGENT") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("HTTP_USER_AGENT"), "Browser_type"
End If
FP_SaveFieldToDB fp_rs, Now, "Timestamp"
If Request.ServerVariables("REMOTE_USER") <> "" Then
FP_SaveFieldToDB fp_rs, Request.ServerVariables("REMOTE_USER"), "User_name1"
End If
fp_rs.Update
FP_DumpError strErrorUrl, "Cannot update the database"
fp_rs.Close
fp_conn.Close
FP_FormConfirmation "text/html; charset=windows-1252",_
"Form Confirmation",_
"Thank you for submitting the following information:",_
"Default.asp",_
"Return to the form."
End If
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="Content-Language" content="en-us">
<title>Home Page</title>
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
</head>
<body>
<form method="POST" action="--WEBBOT-SELF--" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1">
<!--webbot bot="SaveDatabase" SuggestedExt="asp"
U-ASP-Include-Url="_fpclass/fpdbform.inc" S-DataConnection="RA"
S-RecordSource="UserRegistrationReclaimAmerica"
U-Database-URL="fpdb/ReclaimAmerica.mdb"
S-Builtin-Fields="HTTP_USER_AGENT REMOTE_HOST Timestamp REMOTE_USER"
S-Builtin-DBFields="Browser_type1 Remote_computer_name1 Timestamp1 User_name"
S-Form-Fields="txtEmailAddress txtPassword txtVerifyPassword txtUserName txtFirstName txtMailingAddress txtLastName txtZipCode"
S-Form-DBFields="Email\ Address Password VerifyPassword UserName First\ Name Mailing\ Address Last\ Name ZipCode"
-->
<table border="1" width="587" height="1">
<tr>
<td width="136" height="5">First Name</td>
<td width="451" height="5"><!--webbot bot="Validation"
S-Display-Name="FirstName" S-Data-Type="String" B-Allow-Letters="TRUE"
B-Value-Required="TRUE" I-Minimum-Length="1" --><input type="text" name="txtFirstName" size="20"></td>
</tr>
<tr>
<td width="136" height="1">Last Name</td>
<td width="451" height="1"><!--webbot bot="Validation"
S-Display-Name="Last Name" S-Data-Type="String" B-Allow-Letters="TRUE"
B-Value-Required="TRUE" I-Minimum-Length="1" --><input type="text" name="txtLastName" size="20"></td>
</tr>
<tr>
<td width="136" height="1">Email Address</td>
<td width="451" height="1"><!--webbot bot="Validation"
S-Display-Name="Email Address" B-Value-Required="TRUE"
I-Minimum-Length="1" I-Maximum-Length="50" --><input type="text" name="txtEmailAddress" size="20" maxlength="50"></td>
</tr>
<tr>
<td width="136" height="26">Mailing Address</td>
<td width="451" height="26"><!--webbot bot="Validation"
S-Display-Name="Mailing Address" B-Value-Required="TRUE"
I-Minimum-Length="1" I-Maximum-Length="50" --><input type="text" name="txtMailingAddress" size="20" maxlength="50"></td>
</tr>
<tr>
<td width="136" height="14">Zip Code</td>
<td width="451" height="14"><!--webbot bot="Validation"
S-Display-Name="ZipCode" S-Data-Type="String" B-Allow-Digits="TRUE"
B-Value-Required="TRUE" I-Minimum-Length="5" I-Maximum-Length="5" --><input type="text" name="txtZipCode" size="20" maxlength="5"></td>
</tr>
<tr>
<td width="136" height="1">User Name</td>
<td width="451" height="1"><!--webbot bot="Validation"
S-Display-Name="UserName" S-Data-Type="String" B-Allow-Letters="TRUE"
B-Allow-Digits="TRUE" B-Value-Required="TRUE" --><input type="text" name="txtUserName" size="20">
<table width="100%" border="1" height="134">
<tbody>
</tbody>
</table>
</td>
</tr>
<tr>
<td width="136" height="1">Password</td>
<td width="451" height="1"><!--webbot bot="Validation"
S-Display-Name="Password" S-Data-Type="String" B-Allow-Letters="TRUE"
B-Allow-Digits="TRUE" B-Value-Required="TRUE" --><input type="text" name="txtPassword" size="20"></td>
</tr>
<tr>
<td width="136" height="1">Verify Password</td>
<td width="451" height="1"><!--webbot bot="Validation"
S-Display-Name="VerifyPassword" S-Data-Type="String"
B-Allow-Letters="TRUE" B-Allow-Digits="TRUE" B-Value-Required="TRUE" --><input type="text" name="txtVerifyPassword" size="20"></td>
</tr>
<tr>
<td width="136" height="1"><input type="submit" value="Submit" name="B1"><input type="reset" value="Clear" name="B2"></td>
<td width="451" height="1"></td>
</tr>
</table>
<p> </p>
</form>
</body>
</html>