Solved

recordset and memory.

Posted on 1998-10-20
2
163 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

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Using "ScreenUpdating" 6 65
Excel VBA, find a string in a column, update a cell 7 80
MS Access 03, TransferText, decimal places 8 69
IF ELSE Statement in Excel Macro VBA 16 64
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
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…

777 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