Solved

recordset and memory.

Posted on 1998-10-20
2
162 Views
Last Modified: 2010-04-30
hi,
thank you first.
I have a question about opening recordset and how much memory will it take?

I have a function f1, within f1 I call f2 which open 2 recordsets
Set rst1 = db.openrecordset(sql, ...) like that.
when f2 is finish and about to end function, I did
?db.recordsets.count and found out those 2 recordsets are still open.
Here is my first question:
Should I set rst1,2 = nothing now and why?
Now I exit f2 and go back to f1. If I do ?db.recordsets.count, it will have 0.
But I think those 2 recordsets are still taking up memory, right?
Should I always set rst = nothing? and if i don't do that, will it take up space even I end the program?

How can I prove that if it is true?

ny971181

Thank you very much and have a nice day!

0
Comment
Question by:ny971181
2 Comments
 
LVL 2

Accepted Solution

by:
BergJC earned 50 total points
ID: 1440746
You should always close your recordsets when you are finished with them, either by setting them equal to nothing, or with the Close method. After you close the recordsets, they won't be taking up any memory. How can you tell? That's a tough one. If you actually have a recordset big enough to move the System resources percentage in Control Panel/System tab, you can look that way. Open the recordset, check the system resources, then close it and see if it goes back to what it was before you opened it.
0
 
LVL 14

Expert Comment

by:waty
ID: 1440747
You should always do "set rst1 = nothing"... when you don't need anymore the recordset. Otherwise, after several times, you will have lack of memory
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

912 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now