I've been going through my application doing some housekeeping to make it run faster and better, and I had a question regarding a recordset operation. I know enough to use them, but not enough to know if I'm doing it the best way, or sometimes even the right way! I want to make sure I close out the routine properly, clear variables, release memory, whatever. So, in a typical routine that goes:
Dim dDBS As Database
Dim rstDATA As Recordset
Set dDBS = CurrentDb
Set rstDATA = dDBS.OpenRecordset("Table name"
...
...
dDBS.Close
Set rstDATA = Nothing
Are the last lines in the right order? Do I need to set dDBS also to Nothing (before or after closing?)? Am I missing anything? Am I doing it right?
Thanks in advance.
Dim dDBS As Database
Dim rstDATA As Recordset
Set dDBS = CurrentDb
Set rstDATA = dDBS.OpenRecordset("Table name"
...
...
dDBS.Close
Set rstDATA = Nothing
Are the last lines in the right order? Do I need to set dDBS also to Nothing (before or after closing?)? Am I missing anything? Am I doing it right?
Thanks in advance.