Selasa, 25 Oktober 2011

Re: [MS_AccessPros] Closing rst's and setting = Nothing etc.

 

Hi Connie,

example cleanup code
'~~~~~~~~~~~~~~~~~~~~~~~~

Proc_Exit:
   on error resume next
   if not rs is nothing then
      rs.close
      set rs = nothing
   end if
   set db = nothing 'if assigned to CurrentDb or DBEngine(0)(0)
'if db was assigned using OpenDatabase, it will have to be closed like rs

'~~~~~~~~~~~~~~~~~~~~~~~~  

Warm Regards,
Crystal

 *
   (: have an awesome day :)
 *

________________________________
From: mrsgoudge

In an event several recordsets are created.  Some of them are not used in certain instances where the sub exits because of conditions.  In the Exit Procedure Can I close and set = Nothing all the recordsets that were created at the beginning even though they were not set to anything?

Thanks!
Connie

[Non-text portions of this message have been removed]

__._,_.___
Recent Activity:
MARKETPLACE

Stay on top of your group activity without leaving the page you're on - Get the Yahoo! Toolbar now.

.

__,_._,___

Tidak ada komentar:

Posting Komentar