Solved

recordset and memory.

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
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…
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

830 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