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.
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.
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
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.