[AccessD] Open Recordsets when Out Of Scope?

Charlotte Foust cfoust at infostatsystems.com
Fri Jun 20 13:49:38 CDT 2003


Talk to the Microsoft Access/VBA team!  The object variable doesn't
always get reliably destroyed when it goes out of scope even though it
is supposed to, and a lot of odd behavior like not allowing the Access
process to terminate can be traced back to those undestroyed object
variables.  The object isn't still open but it hasn't disappeared
entirely either. And keep in mind that closing those objects and setting
them to nothing aren't the same thing.  It's the setting them to nothing
that really destroys them.

Charlotte Foust

-----Original Message-----
From: Dan Waters [mailto:dwaters at usinternet.com] 
Sent: Friday, June 20, 2003 10:26 AM
To: Database Advisors
Subject: [AccessD] Open Recordsets when Out Of Scope?


To:  Susan Harkins and Charlotte Foust

Authors of 'Preventing and recovering from database bloat' in the latest
issue of Inside MS Access.

Thanks for this article!  More stuff I didn't know. . .

But - If an recordset or querydef object variable is defined inside a
procedure how can a recordset or querydef stay open after that procedure
is out of scope?  Is this a known bug?  Happens under certain
circumstances?

I had read in the ADH that all recordsets are closed when you go out of
scope, so now I don't add code to explicitly close them (except when
closing is needed inside the procedure).

Thanks,
Dan Waters


_______________________________________________
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com


More information about the AccessD mailing list