DoEvents and DBEngine.Idle questions 
Author Message
 DoEvents and DBEngine.Idle questions

Struggling with a possible problem with a multiuser database (oops - now
the client called and said that he was wrong, it isn't locking, just
taking a long time yesterday and so his employees were using task manger
to shoot it.  how long is long - 20 seconds! - and he said their
server/network was having problems yesterday - slow - maybe because of
nimda) and I saw in Build Applications with Microsoft 97 that they used
a DoEvents...

... Error handler asking if want to continue waiting on a lock ...
'Yield to Windows
DoEvents
intrndcount=intlockcount ^2*int(Rnd *3000 + 1000)
for inti=1 to intrndcount:next inti
Resume

I have similar code though I use the Sleep API

Why did MicroSoft use DoEvents?

Is it necessary to us DBEninge.Idle in a multiuser application?

Thanks

--
Mark Gordon

314-647-8880 x352



Mon, 08 Mar 2004 05:32:37 GMT  
 DoEvents and DBEngine.Idle questions

<<
<<Struggling with a possible problem with a multiuser database (oops - now
<<the client called and said that he was wrong, it isn't locking, just
<<taking a long time yesterday and so his employees were using task manger
<<to shoot it.  how long is long - 20 seconds! - and he said their
<<server/network was having problems yesterday - slow - maybe because of
<<nimda) and I saw in Build Applications with Microsoft 97 that they used
<<a DoEvents...
<<
<<... Error handler asking if want to continue waiting on a lock ...
<<'Yield to Windows
<<DoEvents
<<intrndcount=intlockcount ^2*int(Rnd *3000 + 1000)
<<for inti=1 to intrndcount:next inti
<<Resume
<<
<<I have similar code though I use the Sleep API
<<

<<Why did MicroSoft use DoEvents?
<<

I don't know. The author of that code must have hit a specific issue when testing it and put in the DoEvents to have
Windows finish other tasks before continuing the code. Typically, I wouldn't really use DoEvents here.

<<Is it necessary to us DBEninge.Idle in a multiuser application?

No, it's not always necessary. But it does take care of some problems that might arise. The Idle method is often used with
the dbRefreshCache argument, which refreshes memory with the most current data from the database. It also may increase
performance in a multiuser environment because it forces the database engine to write data to disk, releasing locks on
memory.

Sincerely,

Keith Fink
Microsoft Developer Support

This posting is provided AS IS with no warranties, and confers no rights. You assume all risk for your use.
? 2001 Microsoft Corporation. All rights reserved.



Tue, 09 Mar 2004 21:44:02 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. 'DBEngine.Idle dbRefreshCache' ERROR

2. MDB Lock during readonly snapshot and DBEngine.Idle????

3. DBEngine.Idle dbRefreshCache

4. DBEngine.CompactDatabase question

5. DAO.DBEngine question

6. A Very Newbie question. Re:DBEngine

7. DBEngine.INIPath question

8. DAO questions... DBEngine vs Workspace vs Database

9. DBEngine.INIPath question

10. A DBEngine/user question

11. Newbie idle time question

12. doevents question

 

 
Powered by phpBB® Forum Software