is Nothing vs = Empty
- From: "Laurel" <FakeMail@xxxxxxxxxxx>
- Date: Sun, 30 Sep 2007 15:26:26 -0400
I want to put code in my routines to be sure that a recordset is never left
unclosed, to prevent memory leaks, as I've been advised. The following
script was suggested, and it seems to work fine. Sometime the recordset
shows a value of "Nothing" when I hover over it in the debugger, and the
code is not executed. Sometimes it is populated, and the code is executed.
Great. But sometimes the recordset shows a value of "Empty" when I hover
over it in the debugger, and in those cases the code is executed and I get
an error: "Object Required" I haven't been able to figure out what causes a
recordset to = "Empty" in some situations and "Nothing" in others. Can
someone suggest code that will work in all situations? I don't know how to
test for "Empty."
If Not (irst_ClassPeriods Is Nothing) Then
irst_ClassPeriods.Close
Set irst_ClassPeriods = Nothing
End If
.
- Follow-Ups:
- Re: is Nothing vs = Empty
- From: Dirk Goldgar
- Re: is Nothing vs = Empty
- Prev by Date: Access 2007 calculating . . . for a long time
- Next by Date: Re: is Nothing vs = Empty
- Previous by thread: Access 2007 calculating . . . for a long time
- Next by thread: Re: is Nothing vs = Empty
- Index(es):
Relevant Pages
|