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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check num of user and restart database in exclusive mode

Status
Not open for further replies.

jack1080

Programmer
Jun 2, 2007
34
MY
1. Am I right that if a user open the database in exclusive mode, meaning no other user can open it?
2. Is it possible to use vba to
a)Check for how many user are using the database, if I am the only one
b)Reopen the access database in exslusive mode?
 
To close and open the database you will need the following methods. The latter allows you to specify opening the database exclusively.

CloseCurrentDatabase
OpenCurrentDatabase

As for checking if you are the only user... The only thing that comes to mind is reading the LDB file.

Perhaps a better way is to make a second database file that you open via automation that closes the database you are conscerned about and trys to open it exclusively. If it is already opened by someone else, you will get an error that you can trap and handle (perhaps reopen the database not exclusively?).

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top