Barry, one more question.
What if I declare something like this
Private rsSQL As DAO.Recordset
Should I kill it as well?
Thanks a lot, Lina
Yes! Anytime you instantiate an object that requires the New keyword, you
should kill it. One or two un-killed objects won't hurt, but an app that's
left up for a while or one in which you do a lot of these will eat memory and
eventually cause errors. For this reason, it's considered a best pratice to
explicitly destroy all objects when you're finished with them. Kind of like
Godzilla!
Barry
> Barry, one more question.
> What if I declare something like this
[quoted text clipped - 33 lines]
> > >
> > > Thanks a lot, Lina
Lina Manjarres - 18 Sep 2006 23:26 GMT
Thank you very much!
> Yes! Anytime you instantiate an object that requires the New keyword, you
> should kill it. One or two un-killed objects won't hurt, but an app that's
[quoted text clipped - 42 lines]
> > > >
> > > > Thanks a lot, Lina
Lina Manjarres - 28 Sep 2006 21:06 GMT
Hello Barry
I have been doing what you recomended me. It's getting better, the error
message appears less than before. I do not know if I made a mistake, trying
to have a module to kill this opened recordsets.
I made a module like this. And then I called it form the error message you
show me how to make it. I just pass the recordsets I am using. I do not know,
if this is correct or I may be leaving things unclose and that's why I am
still getting the same error message, even thou it is less frequent.
Public Sub TreeViewErrorHandler_Click(rst1 As DAO.Recordset, _
Optional rst2 As DAO.Recordset, _
Optional rst3 As DAO.Recordset)
If Not IsMissing(rst1) Then Set rst1 = Nothing
If Not IsMissing(rst2) Then Set rst2 = Nothing
Set rsSQL = Nothing
Set rsSQL1 = Nothing
Set dbs = Nothing
End Sub
> Yes! Anytime you instantiate an object that requires the New keyword, you
> should kill it. One or two un-killed objects won't hurt, but an app that's
[quoted text clipped - 42 lines]
> > > >
> > > > Thanks a lot, Lina