Solved

recordset and memory.

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

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…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

758 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

18 Experts available now in Live!

Get 1:1 Help Now