Print Page | Close Window

strange error when closing RS

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=3204
Printed Date: 29 March 2026 at 3:06pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: strange error when closing RS
Posted By: Scotty32
Subject: strange error when closing RS
Date Posted: 02 June 2003 at 5:02am

am confused about an error i keep getting....

ADODB.Recordset error '800a0e78'

Operation is not allowed when the object is closed.

/page.asp, line 13

but the strange thing is... am tryin to "close" the recordset on like 13

b4 i put the "response.redirect" above closing to get it to work.....

but then i thought it wouldnt close the record set

does anyone understand this?




Replies:
Posted By: TYSON
Date Posted: 02 June 2003 at 7:31am
Are you sure the recordset is open?

-------------
http://www.fuo-motorsports.com/ - http://www.fuo-motorsports.com/


Posted By: Gullanian
Date Posted: 02 June 2003 at 8:16am

Yeah, you can only get that error if the recordset is definatly open, post your code here if its not too big

sounds like you alreasy closed it, before u redirect do:

set rsObj = Nothing

as well



Posted By: farrukh
Date Posted: 02 June 2003 at 3:21pm
please paste the code here................ so we can help u

-------------
i have collected some nice avatars (37) and smileys (227) here you can download
http://www24.brinkster.com/webmastertool/download.html


Posted By: Scotty32
Date Posted: 03 June 2003 at 2:47am

<!--#include virtual="/include/global.asp"-->
<%
id = Request.QueryString("id")
CID = Request.QueryString("CID")
PID = Request.QueryString("PID")
%>
<!--#include virtual="/include/Conn.asp"-->

<%
  sql = "DELETE * FROM Notes WHERE ID = " & ID
  set rsDelete = conn.Execute(sql)
 
  rsDelete.close
  set rsDelete = nothing
  conn.close
  set conn = nothing


 response.redirect("notes-frame.asp?CID=" & CID & "&PID=" & PID)
%>

 see.... i havent closed it yet... for sum reason it doesnt like to close it

the line in red is line 13



Posted By: Gary
Date Posted: 03 June 2003 at 2:51am

I'm not 100% sure on this, but I dont think that you can close a recordset - you can only set it to Nothing.

It is the connection which needs to be closed (as you have done so in your code).



Posted By: Scotty32
Date Posted: 03 June 2003 at 2:55am

oh... well i kinda learn from this other (kinda crap and "nameless") forum

but i close the RS on other pages and it works fine... hense the reason am confused

it works on sum pages but not others



Posted By: michael
Date Posted: 03 June 2003 at 8:16am
You problem is not rs.Close your problem is your SQL syntax. It is not Delete *....
it is just like "Delete FROM Notes WHERE ID = " & ID

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: testp
Date Posted: 05 June 2003 at 12:56am

You only need to close a recordset if you actually opened one. For a DELETE operation no recordset is necessary so it was not created.



Posted By: Scotty32
Date Posted: 05 June 2003 at 6:22am

thanks for the help, it work now

(since i aint tryna close the rs)




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net