Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

concurrency issue with MS Access 1

Status
Not open for further replies.

robinsql

Programmer
Aug 2, 2002
236
0
0
IE
Hi,

I am running a piece of software which uses two scanners in two comports on my PC.
When information arrives at the Scanners at the same time, I get an error saying the DB is locked, as it can't do the update at the same time.
How can I prevent this from happening?
Can I check the state of the DB to see if it is locked, and if so maybe loop until it is not?

Thanks for any help,
Robin
 
You need to add error handling to catch this error when it occurs. Then you can use a timer, so that it attempts to do the same process 10 times, over 5 seconds, until it has access. If it gets to the time limit and the action has not been performed, you then want to add a msgbox so the user can either try again or cancel.

Firstly, you need to obtain the error number specific to this fault, so that you know this action will only happen when the db is locked, and not for all errors, such as db does not exist.

BB
 
Thanks very much BB,
have it sorted
Cheers,
Robin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top