I am trying my best to set all the objects I use to Nothing when a form unloads. The objects I use are ADO recorsets and ADO commands.
My problem is sometimes an object is not iniated using the SET statement so when I come to close it I get an error.
My solution is just to SET it again as a NEW occurance of the object and then set it to nothing. However, my question is what if IT HAS been SET before - does resetting clear all the resources nicely or are they left hanging in the computers memory somewhere.
An example would be:
DIM rstemp as ADODB.RECORDSET
SET rstemp as NEW ADODB.RECORDSET
- load up the recordset with data -
SET rstemp as NEW ADODB.RECORDSET
SET rstemp=NOTHING
You will see that I have created a new instance of rstemp (2 in total) but set it to Nothing once. What happens to the original?
My problem is sometimes an object is not iniated using the SET statement so when I come to close it I get an error.
My solution is just to SET it again as a NEW occurance of the object and then set it to nothing. However, my question is what if IT HAS been SET before - does resetting clear all the resources nicely or are they left hanging in the computers memory somewhere.
An example would be:
DIM rstemp as ADODB.RECORDSET
SET rstemp as NEW ADODB.RECORDSET
- load up the recordset with data -
SET rstemp as NEW ADODB.RECORDSET
SET rstemp=NOTHING
You will see that I have created a new instance of rstemp (2 in total) but set it to Nothing once. What happens to the original?