Solved

DBEngine.Idle

Posted on 2000-03-14
1
1,167 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
[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
1 Comment
 

Accepted Solution

by:
RPoate earned 100 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…

752 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