Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Operation is not allowed when the object is closed.

Status
Not open for further replies.

TheCandyman

Technical User
Sep 9, 2002
761
US
I am getting an error on my DB and i can't see what is wrong with it. the error is:

ADODB.Recordset error '800a0e78'
Operation is not allowed when the object is closed.
/login/Password_create.asp, line 27

I searched around and i think that error is given when a blank is returned from an SQL statement, but i am trying to update a DB so i don't see why that should matter. It does update the DB, but it errors on the close. I can't see anywhere else that i closed it. The page before i didn't even touch the DB, and the top of this page i open it...Here is my code...

<%Response.Buffer=TRUE%>

<%Set conn = server.createobject(&quot;adodb.connection&quot;)
Path = Server.Mappath(&quot;db/WEBDB.MDB&quot;)
DSNtemp = &quot;Provider=Microsoft.Jet.OLEDB.4.0;Data Source=&quot; & Path
conn.Mode = 3
conn.Open DSNtemp

uid = Request.Form(&quot;ADAnum1&quot;) + Request.Form(&quot;ADAnum2&quot;) + Request.Form(&quot;ADAnum3&quot;)
pwd = Request.Form(&quot;pwd&quot;)
email = Request.Form(&quot;email&quot;)

SQL = &quot;Select * From MemInfo Where ADANum = '&quot; & uid & &quot;'&quot;
Set RS = Conn.Execute(SQL)

If Not RS.EOF Then
response.write Path & &quot;<br>&quot;
response.write pwd & &quot;<br>&quot;
response.write email & &quot;<BR>&quot;
response.write uid & &quot;<br>&quot; & &quot;Found&quot; & &quot;<br><br><br>&quot;


SQL2 = &quot;UPDATE Meminfo SET pwd = '&quot;& pwd &&quot;' WHERE ADANum='&quot;& uid &&quot;';&quot;
' , email = '&quot;& email &&quot;'
Conn.Execute(SQL2)
Conn.Close
RS.Close <-- Error is here
Set RS = Nothing
'response.clear
'Response.Redirect &quot;Login.asp&quot;
Else
...
...
...
 
Hey there,

I guess u just need to interchange the statements Close conn and RS.close. Close the connection to database after u close the record set u used.... I am not sure how helpful this is. Just try it...

Mythologyrocks!!!
 
I switched those 2 lines and it worked!!

to be honest i didn't think it would. Why would i delete the RS.Close? I have stuff in it, i need to destroy it correct?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top