How to Check if a MS Access Jet Database Table is locked

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
m4nc43
Newbie
Posts: 1
Joined: Sat Feb 08, 2014 4:54 am

How to Check if a MS Access Jet Database Table is locked

Post by m4nc43 » Sat Feb 08, 2014 5:22 am

Hi! I am getting a database error message that saids,

The Microsoft Jet Database engine cannot open the file 'D:\db1.mdb'. It is already opened exclusively by another user, or you need permission to view its data

The script can access the table in the beginning so permission is not an issue, but I think the way that the script constantly read and update the database and after a while(i.e. after the table had been accessed many times) this error popped up. My guess is that a database instructions was in mid-execution when a new instruction try to gain access to the table and execute.

Is there a database command to check if a MS Access Jet Database table is locked? Thankyou very much in advance if anybody can shed some light on this:)

User avatar
Marcus Tettmar
Site Admin
Posts: 7395
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Mon Feb 10, 2014 3:29 pm

Is this a Macro Scheduler question?

I would have thought if the database was locked you'd get an error back from DBConnect. You could look at that error code to determine whether you are able to continue or not.
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts