Solved

DBEngine.Idle

Posted on 2000-03-14
1
1,079 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 100 total points
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

728 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

8 Experts available now in Live!

Get 1:1 Help Now