ACC2000: To Help Prevent Database Bloat, Explicitly Close Recordsets (209847)
The information in this article applies to:
This article was previously published under Q209847 Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access database (.mdb).
For a Microsoft Access 2002 version of this article, see 289562.
SYMPTOMS
In Microsoft Access, if you use Data Access Objects (DAO) to open a recordset and you do not explicitly close the recordset, DAO may hold onto the memory that it used for its previous compile until the next recordset is opened.
CAUSE
Because the recordset memory is not released, each time that you loop through code, DAO may recompile, using more memory and increasing the size of the database.
RESOLUTION
To avoid consuming unnecessary resources and increasing database size, use
the Close method of the Recordset object to explicitly close the recordset's memory when you no longer require the recordset.
If the database has increased in size because you did not use the Close method of the Recordset object, you can reduce the size of the database by compacting it.
Modification Type: | Major | Last Reviewed: | 6/23/2005 |
---|
Keywords: | kbdta kbprb KB209847 |
---|
|