How would you see this being useful?
If you succesfully opened the database in Exclusive mode then you retain exclusive mode.
If you succesfully opened the database in Shared mode, you will not get into Exclusive mode until try to do something that requires it, so you can't test for it before you attempt that action (because you are still in Shared mode).
I have a shared database that 10 users input orders into. At the end of the year I want to archive the past years orders into a spreadsheet and delete the records from the database. Unfortantely the admin user is not very good at enforcing that all users logoff wnen this process is started. So I either have to try and lock all the records or open the database in exclusive mode to make sure that no other users have a record called up that I want to archive. I thought I would check the open mode in the VB code before the process starts. Is there an easier way?
You could create a macro to do the job.
Then use windows scheduler to open the database and run that macro at a time when there will be no users. The command line allows you to specify the macro name to run.
Include a Quit database action in the macro to shut everything down again.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.