set DAO.recordset to nothing

  • Thread starter Thread starter iccsi
  • Start date Start date
I

iccsi

I would like to know when I have to set DAO.recordset = Nothing.

Do I need have set it to nothing at label Exit_MyEvent that make sure
even function failed still free the memory? or I can set it to nothing
in the end of function.


By the way, Do I need set DAO.QueryDef to nothing as well, since I use
set statement to assign value to DAO.QueryDef.

Your information is great appreciated,
 
Post your code and we can give you advice that is specific to your setup.

In general, setting a Recordset object to Nothing (after closing it first)
is good practice -- and to do it in code that runs every time in the
procedure. Thus, putting it in the Exit label block is good if the Exit
label block is always run in the procedure, no matter if you have errors or
logic jumps or whatever.
 
Back
Top