set rs = nothing really necessary

casey

Registered User.
Local time
Today, 14:38
Joined
Dec 5, 2000
Messages
448
hello,

quick ADO question...

Must I (set rs = nothing) when I'm done? I've always done that, but seeing a lot of code that neglects doing so. Is it advisable to do or can I merely use. (rs.close)

What are the consequences of not setting = nothing?

Also, should I wait until I'm finished with the rs at the end of the code? or should I set rs = nothing for every recordset that i open regardless if I reuse the recordset over and over?

Thanks.
 
You don't have to destroy the variable by setting it equal to nothing until you are through with it, but you should do so before exiting your program. Setting it to nothing is basic garbage collection and removes the object from memory and without doing so you can wind up causing "memory leak."
 
thanks. boblarson,

So this would have no effect on locking tables/recordsets? As long as the recordset is closed?
 
Thanks again.

I have a recordset (one table) that I open, update(one field) and close the rs with ADO. After doing all of this, the table remains inaccessible and I can't access it through Enterprise Manager or Access. Is there something that you can think of that would cause the table to remian locked after it's updated and closed.
 
Thanks for your help. I will repost when I get the time.
 

Users who are viewing this thread

Back
Top Bottom