Solved

recordset and memory.

Posted on 1998-10-20
2
166 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
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…
Suggested Courses
Course of the Month8 days, 21 hours left to enroll

617 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