By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,647 Members | 1,124 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,647 IT Pros & Developers. It's quick & easy.

DoCmd.OpenQuery takes up memory?

P: 1
Hi all,

Just a small question concerning the memory problem. Whenever we open an existing query inside a module:

DoCmd.OpenQuery ("Query Name")

Do we have to put another command line to close the query? Because I'm suspecting this will retain the results obtained from the query into the memory and expand the Access file. Since whenever we open a record set, we have to close it. I'm just wondering if we really need to close the query to prevent the file keep expanding since all of my access files are getting bigger everyday even though I haven't add anything to them, just re-run the modules. If we need to put a closing command, what is it?

Thanks a lot! Have a nice day folks!
Jan 31 '08 #1
Share this Question
Share on Google+
1 Reply


MMcCarthy
Expert Mod 10K+
P: 14,534
Hi all,

Just a small question concerning the memory problem. Whenever we open an existing query inside a module:

DoCmd.OpenQuery ("Query Name")

Do we have to put another command line to close the query? Because I'm suspecting this will retain the results obtained from the query into the memory and expand the Access file. Since whenever we open a record set, we have to close it. I'm just wondering if we really need to close the query to prevent the file keep expanding since all of my access files are getting bigger everyday even though I haven't add anything to them, just re-run the modules. If we need to put a closing command, what is it?

Thanks a lot! Have a nice day folks!
You need to close the query. However, the memory issue will remain. Access retains a lot of information in its memory until its dumped. You do this by running Compact and Repair. Shedule this for a time when no users are on the system. It will clear the memory.
Feb 5 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.