Preventing Exclusive Access

  • Thread starter Thread starter John Pritchard
  • Start date Start date
J

John Pritchard

My application is a simple .mdb with no user logins /
workgroup files written in Access 2000 on NT. I've made
sure that the advanced tab under tools->options has
default mode set to shared and (following earlier advice)
that all file permission are everything to everybody.
Occasionally I get a call saying the database is locked
exclusively (which it is) and I ask the user to exit then
I 'login' to my application and wait for > 1 person to be
in then all is OK. I know you can open an application
exclusively by entering Access first then using open
exclusive - can I prevent this for my application /
database i.e. force the database to be shared at all
times ?

Thanks for any advice !
 
simplest solution is to put the database in a new location, so that nobody else knows where it's located. Then email everyone a shortcut to it. This will probably stop 95% of your headache as most people won't take to time to figure out where it's located - so they won't open it via access, but will use your shortcut instead.

I know that in A97, when a database is opened exclusively, the .ldb file is NOT created. You can have a hidden form check for the presence of the .ldb file, and if it is missing, automatically shutdown.

-hai

----- John Pritchard wrote: -----

My application is a simple .mdb with no user logins /
workgroup files written in Access 2000 on NT. I've made
sure that the advanced tab under tools->options has
default mode set to shared and (following earlier advice)
that all file permission are everything to everybody.
Occasionally I get a call saying the database is locked
exclusively (which it is) and I ask the user to exit then
I 'login' to my application and wait for > 1 person to be
in then all is OK. I know you can open an application
exclusively by entering Access first then using open
exclusive - can I prevent this for my application /
database i.e. force the database to be shared at all
times ?

Thanks for any advice !
 
Thanks hai - I like simple ideas - my only worry is the 5%
who will figure it out. I'll check out the .ldb file
behaviour in A2k - if it works the same do you know how to
check for it's existence from within Access ? - I've less
than 6 mnths in Access so still learning !

Thanks again

John P.

-----Original Message-----
simplest solution is to put the database in a new
location, so that nobody else knows where it's located.
Then email everyone a shortcut to it. This will probably
stop 95% of your headache as most people won't take to
time to figure out where it's located - so they won't open
it via access, but will use your shortcut instead.
I know that in A97, when a database is opened
exclusively, the .ldb file is NOT created. You can have a
hidden form check for the presence of the .ldb file, and
if it is missing, automatically shutdown.
 
John-

here's how you do it (code untested):
1 - create a blank form
2 - in the on open event of the form, put the following code (with the
quotes)
if dir("path to .ldb on your server") = vbnullstring then
application.quit

3 - save the form
4 - create a new macro, call it: autoexec
5 - have the macro open the form, with the window mode set to hidden

the macro will automatically run when the database is opened. It will
open the form, which will check for the .ldb file. If the file is
missing, it will shutdown.

hope this helps.
-hai

************************************************
 
Back
Top