L
Laurel
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
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