Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

DBEngine.Idle

Posted on 2000-03-14
1
Medium Priority
?
1,281 Views
Last Modified: 2008-02-20
Hi,

I am wondering where is the best place to use DBEngine.Idle dbRefreshCache in my data objects.

My objects encapsulate some DAO functionality.

E.g. Customer Object has the following methods:

AddNew
Delete
Update
Load
SaveChanges
MoveNext
MoveFirst

...etc
Get the picture?

For a multiuser environment DAO literature quotes that you should periodically use DBEngine.Idle dbRefreshCache to suspend processing and let the DAO engine catch up.

My question is where would be the best place to use this in my objects.

I was thinking of sticking it in all the methods that change the recordset,i.e  AddNew,Delete, Update and SaveChanges.

I am thinking correct or do I need certifying?

Should I just use it on all the methods including MoveFirst, MoveNext etc.

Thanks in Advance.

Best Wishes

Adrian Evans
United Kingdom.
0
Comment
Question by:AdiEvans
1 Comment
 

Accepted Solution

by:
RPoate earned 200 total points
ID: 2622719
My first thought on this one is that
"if it ain't broke don't fix it". In other words if you do not have a problem then you don't need to worry about it.

I found that I had a problem where I was changing the database tables (adding columns). When I tried to write to the columns to set values in then I was told that the columns did not exist.  When I looked in Access the columns were there.

I found out that if I delayed setting the column values then it worked.

It turned out to be a "NT4 lazy disk write" problem. NT "said" it had written the changes to disk but in fact it had not.  It took a few seconds to flush its buffers.

I solved the problem with:

CDB_WS.BeginTrans
DBEngine.Idle dbRefreshCache
CDB_WS.CommitTrans dbForceOSFlush

So in general terms I would suggest that you can use it anywhere you like but really it is only necessary if you have a problem.

Regards
Robert Poate

PS I'm not sure if this is a comment or an answer.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
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

916 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