How do I ensure Single User?

  • Thread starter Thread starter Pat
  • Start date Start date
P

Pat

I want to make sure that only 1 user is able to launch the database and run
the app. What is the best way to accomplish this?
 
If all you want to do is make sure that no more than one person can use the
database at a time, then you can set the databases Default Open Mode
(Tools -> Options - Advanced tab) to Exclusive.

Dale
 
Dale said:
If all you want to do is make sure that no more than one person can
use the database at a time, then you can set the databases Default
Open Mode (Tools -> Options - Advanced tab) to Exclusive.

That does not set the default open mode on the file for all users. It sets
the default open mode for the current user of Access for all files.
 
Pat said:
I want to make sure that only 1 user is able to launch the database and run
the app. What is the best way to accomplish this?

Add the following to the target field of all shortcuts that open the
database:

" /excl"

(don't type the quotes)
 
Stuart McCall said:
Add the following to the target field of all shortcuts that open the
database:

" /excl"

(don't type the quotes)

And make sure that the shortcut includes the full path to msaccess.exe

/excl is a parameter of msaccess.exe, not of the mdb file.
 
Thanks guys, I was really looking for a simple way to ensure all users are
locked out no mater what they do. I'll look at security as an option.
 
Pat,

I've only tried this a few times, but the following should do it. Run this
sub after you launch the database, setting intValue to 1. Make sure to set
it to 2 when you shutdown.

Public Sub SetConnectionControl(Optional intValue As Integer = 2)
'Set intValue = 1 to disallow additional user connections
'Set intValue = 2 to allow additional user connections
If intValue = 1 Or intValue = 2 Then
CurentProject.Connection.Properties("Jet OLEDB:Connection Control")
= intValue
Else
Error 9 'Subscript out of range
End If
End Sub

Regards,
Graham R Seach
Microsoft Access MVP
Sydney, Australia
 
Back
Top