Re: Freeing system resources
My guess is that your code that checks whether 2 seconds have passed is in a tight loop and is not giving up control?
Try putting a DoEvents() in the loop - or better still, firing the loop for a VB timer control.
HTH,
Duncan
-------------------------------------------------
Ex. Datis: Duncan Jones
Merrion Computing Ltd
http://www.merrioncomputing.com
Re: Freeing system resources
I am assuming since the search occurs every two seconds that it only takes 1 second to search the entire database at the most ALMOST 2 but never 2 seconds. Consider this however, every 1 second your computers resources are being consumed by searching through the access database. Then the computer gets a short maybe 1 second break to continue the rest of its work.. then it starts searching a database again. Several suggestions would be.. as stated previously,use do events in your loops. But, stay away from loops as much as possible. Loops are inherintly slow in VB, try using an SQL statement to do your search, if you arent already. Possibly it would be worth considering writing the program in C++ and making it a multi-thread.. and if it is important enough use a second processor dedicated to this operation.
Anyways.. I really dont see any way to speed up an application that manually crunches through a database every other second.
Out of curiosity... why would you run a program that so intensively accesses a database on a nearly perpetual timeframe, on the same PC that would be used by employees for other operatioins?