hughesmi
04-23-2004, 01:38 AM
Hi all - IIS is giving me an eror say:
Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
default.asp, line 18
Here is my code, can some please spot where I'm going wrong? I can not figure out why it's saying abject is closed.
<%
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("links.mdb")
'Create an ADO recordset object
Set rsReadpage = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM AdministrationUsers WHERE Username='"& strUsername &"'"
'-- check to see if the user has registered before
If rsReadpage.EOF Then
'If RecordSet.fields("Username")=strUsername Then
If RecordSet.fields("Username")= hughesmi Then
Response.Write("<FONT FACE='ARIAL' SIZE='2'><B>Sorry this email has already been registred, please try again</B></FONT>")
End If
End if
%>
<!-- HTML FORM -->
<html>
<head>
<script TYPE="text/javascript">
<!--hide
function checkPass()
{
if(document.login.firstname.value == false)
{
alert('Please Enter Your First Name')
login.firstname.focus()
return false;
}
if(document.login.lastname.value == false)
{
alert('Please Enter Your Last Name')
login.lastname.focus()
return false;
}
if(document.login.pwd.value == false)
{
alert('You Need to Enter a Password.')
login.pwd.focus()
return false;
}
if(document.login.pwd.value != document.login.password.value)
{
alert('Your Passwords Do Not Match')
return false;
}
else
{
return true;
}
}
//end hide -->
</script>
<title>Password Entry Page</title>
</head>
<body>
<form METHOD="POST" name="login" ACTION="NewReg.asp" onSubmit="return checkPass()">
<fieldset>
<legend><font size="2" face="Tahoma">New Registration</font></legend>
<div align="center">
<center>
<table border="0" cellspacing="0" cellpadding="2" height="131">
<tr>
<td height="9"><b><font face="Tahoma" size="2">First Name:</font></b></td>
<td height="9"> <font face="Tahoma" size="2"> <input NAME="firstname" size="20" style="text-transform: capitalize"> </font> </td>
</tr>
<tr>
<td height="12"><b><font face="Tahoma" size="2">Last Name:</font></b></td>
<td height="12"> <font face="Tahoma" size="2"> <input NAME="lastname" size="20" style="text-transform: capitalize"> </font> </td>
</tr>
<tr>
<td height="21"><b><font face="Tahoma" size="2">Your Username Is:</font></b></td>
<td height="21"><font face="Tahoma"><b><font size="2" face="Tahoma"></font></b></font> </td>
</tr>
<tr>
<td height="21"><b><font face="Tahoma" size="2">Enter a Password:</font></b></td>
<td height="21"><font face="Tahoma" size="2"><input TYPE="password" NAME="pwd" size="20"> </font> </td>
</tr>
<tr>
<td height="25"><b><font face="Tahoma" size="2">Re-type your Password:</font></b></td>
<td height="25"><font face="Tahoma" size="2"><input TYPE="password" NAME="password" size="20"> </font> </td>
</tr>
<tr>
<td height="27"><font face="Tahoma" size="2"><input TYPE="reset" VALUE="Rest"></font></td>
<td height="27">
<p align="center"><font face="Tahoma" size="2"><input TYPE="submit" VALUE="Save Your Details."></font></p>
</td>
</tr>
</table>
</center>
</div>
<p> </p>
<p> </p>
</fieldset>
</form>
<p align="center"></p>
<p align="center"><font size="2" face="Tahoma"><< <a href="default.asp">Back</a></font></p>
</html>
<%
'Reset server objects
rsReadpage.Close
Set rsReadpage = Nothing
Set adoCon = Nothing
%>
Error Type:
ADODB.Recordset (0x800A0E78)
Operation is not allowed when the object is closed.
default.asp, line 18
Here is my code, can some please spot where I'm going wrong? I can not figure out why it's saying abject is closed.
<%
'Create an ADO connection odject
Set adoCon = Server.CreateObject("ADODB.Connection")
'Set an active connection to the Connection object using a DSN-less connection
adoCon.Open = "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("links.mdb")
'Create an ADO recordset object
Set rsReadpage = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT * FROM AdministrationUsers WHERE Username='"& strUsername &"'"
'-- check to see if the user has registered before
If rsReadpage.EOF Then
'If RecordSet.fields("Username")=strUsername Then
If RecordSet.fields("Username")= hughesmi Then
Response.Write("<FONT FACE='ARIAL' SIZE='2'><B>Sorry this email has already been registred, please try again</B></FONT>")
End If
End if
%>
<!-- HTML FORM -->
<html>
<head>
<script TYPE="text/javascript">
<!--hide
function checkPass()
{
if(document.login.firstname.value == false)
{
alert('Please Enter Your First Name')
login.firstname.focus()
return false;
}
if(document.login.lastname.value == false)
{
alert('Please Enter Your Last Name')
login.lastname.focus()
return false;
}
if(document.login.pwd.value == false)
{
alert('You Need to Enter a Password.')
login.pwd.focus()
return false;
}
if(document.login.pwd.value != document.login.password.value)
{
alert('Your Passwords Do Not Match')
return false;
}
else
{
return true;
}
}
//end hide -->
</script>
<title>Password Entry Page</title>
</head>
<body>
<form METHOD="POST" name="login" ACTION="NewReg.asp" onSubmit="return checkPass()">
<fieldset>
<legend><font size="2" face="Tahoma">New Registration</font></legend>
<div align="center">
<center>
<table border="0" cellspacing="0" cellpadding="2" height="131">
<tr>
<td height="9"><b><font face="Tahoma" size="2">First Name:</font></b></td>
<td height="9"> <font face="Tahoma" size="2"> <input NAME="firstname" size="20" style="text-transform: capitalize"> </font> </td>
</tr>
<tr>
<td height="12"><b><font face="Tahoma" size="2">Last Name:</font></b></td>
<td height="12"> <font face="Tahoma" size="2"> <input NAME="lastname" size="20" style="text-transform: capitalize"> </font> </td>
</tr>
<tr>
<td height="21"><b><font face="Tahoma" size="2">Your Username Is:</font></b></td>
<td height="21"><font face="Tahoma"><b><font size="2" face="Tahoma"></font></b></font> </td>
</tr>
<tr>
<td height="21"><b><font face="Tahoma" size="2">Enter a Password:</font></b></td>
<td height="21"><font face="Tahoma" size="2"><input TYPE="password" NAME="pwd" size="20"> </font> </td>
</tr>
<tr>
<td height="25"><b><font face="Tahoma" size="2">Re-type your Password:</font></b></td>
<td height="25"><font face="Tahoma" size="2"><input TYPE="password" NAME="password" size="20"> </font> </td>
</tr>
<tr>
<td height="27"><font face="Tahoma" size="2"><input TYPE="reset" VALUE="Rest"></font></td>
<td height="27">
<p align="center"><font face="Tahoma" size="2"><input TYPE="submit" VALUE="Save Your Details."></font></p>
</td>
</tr>
</table>
</center>
</div>
<p> </p>
<p> </p>
</fieldset>
</form>
<p align="center"></p>
<p align="center"><font size="2" face="Tahoma"><< <a href="default.asp">Back</a></font></p>
</html>
<%
'Reset server objects
rsReadpage.Close
Set rsReadpage = Nothing
Set adoCon = Nothing
%>