One way is to create a shortcut that opens the database exclusively.
Click the Windows Start button, point to Settings, and then click Taskbar &
Start Menu.
Click the Advanced tab, and then click Add.
In the Create Shortcut dialog box, specify a path to the Microsoft Access
program file, or click Browse. It's located by default in C:\Program
Files\Microsoft Office\Office10.
Click to the right of the Access startup command in the box where you type
the location of the item, and then type the desired command-line options.
For example, the following command line starts Microsoft Access and opens
the Northwind sample database for exclusive access.
"C:\Program Files\Microsoft Office\Office10\MSAccess.exe" "C:\Program
Files\Microsoft Office\Office10\Samples\Northwind.mdb" /excl
Search Windows Help for "adding shortcuts" for more information.
You should also be able to run code as it opens to assure it is opened
exclusive and close the database if it is no.
Now the question is why do you want to do this? You should be able to
have two or many people in a database at the same time without steeping on
each other's toes, if you do it right.
If you want two people in at the same time, it is a good idea to have a
front end database on each user's machine that is linked to the back end on
the server.
--
Joseph E. Meehan
26 + 6 = 1 It's Irish Math
dml said:
We have an Access database on a shared network. There are 2 users who use
this database. However, we only want 1 user to be able to log into the
database at any given time. Is there a way restrict the Access database to
only 1 user at a time? If a user is logged in and another user tries to log
in, can the database give them a message as such and deny their access? I
have already asked the other user to look for the .ldb file but they don't
always pay attention...if they log in while another user in logged in it
corrupts the database. I need a way to prevent the database from opening
all together. I have also changed the default opening option to "Exclusive"
but they can still log in while another user in logged in. Does anyone know
if this is possible?