Only allow one user at a time...

hobbes

Registered User.
Local time
Today, 04:05
Joined
Feb 13, 2004
Messages
30
Is there a way to only allow one user at a time into a database? I tried setting the Default Open Mode (found under Tools:Options:Advanced tab) to exclusive, but that still allows more than one person to be in a database and alter data.

Is it also possible to alert the second user of who is in the database already? This bit would just be helpful, but the really important problem is above. Any suggestions??
Thank you!!!
Hobbes
 
Hmm

Could have it so when the DB starts up, it adds their username to a table, and if someone else logs on, it checks that table and alerts if its someone other then them, or if the number of people on is higher than one.

Problem I see with this, is if the DB crashes, or closed differently, it wouldn't remove their name.

Im not super good at this stuff yet, but this is one way.
 
Make them use a custom shortcut with the exclusive command switch.

"C:\Program Files\Microsoft Office\Office\msaccess.exe" "X:\Yourdatabase.mdb" /excl

I believe that you can test if a db was opened as exclusive and close the db on the user if they did not use your shortcut.
 
Do not rely on the *.ldb file to determine who is in a db. It does not always update [remove] from the .ldb file with who has left a db.

Kinda odd that you only want one user to be in your db at a time.
 
Yea, any reason you only want one on at a time?

I think thier might be an easier way to solve this... if we knew the reason.
 
I found an even easier way (thanks to a crafty (like ice is cold) co-worker)! In the properties of your database shortcut, on the Shortcut tab, set your Target to read the location of Access on your hard drive or server and the location of your database. For example: "C:\Program Files\Microsoft Office\Office\MSACCESS.EXE" "C:\Database Folder\Database.mdb" /excl

This will give people an error message saying the database is in use if someone is already in it.

And to answer your question, my database is a list of unique account numbers that can be used, but 35 people set up new accounts and it's a way for them to pull the next available account number without duplicating each other's work. So if there were three people in the database pulling account numbers, then they would be pulling the same number without knowing it.

Thank you again for your help and suggestions!!! :D
 
I am glad that you figured it out but how is that any different than what I posted above in my first response?
Make them use a custom shortcut with the exclusive command switch.

"C:\Program Files\Microsoft Office\Office\msaccess.exe" "X:\Yourdatabase.mdb" /excl

I believe that you can test if a db was opened as exclusive and close the db on the user if they did not use your shortcut.
Also, you have a major design flaw if more than one user can not access the db just because they are creating new [unique] account numbers. You db should be split.
 
My apologies ghudson....you came up with the exact same thing first. I, however, didn't understand it until my co-worker sent me a screenprint of where I needed to put the information. My bad for not realizing it was the same thing you had suggested earlier. :o

I'm a bit confused....Why do you say my database has a flaw and needs to be split? I want everyone to be working off of the same list. If I split the database, wouldn't that split the list too? :confused: Or is there a better solution?
Thanks!
 
Multi-user db's should be split. You will find out the hard way once your db gets corrupted. The front end should be installed onto each users hard drive. The back end should be on the network. Each front end contains all the forms, queries, [just about everything but the tables]. The back end should only contain the shared tables. The front end is linked to the back end.

Everybody should have access to the same data at the same time. obviously you do not want two people to be "editing" the same record at the same time. Access file locking will not allow that.

Your db "flaw" is that fact that only one person can access the data concurrently. You can design the db to create new account numbers that everybody will immediately be able to access.

There is too much to attempt to cover about splitting a db and the how to's about it but you can easily research most of your questions on this forum.

Start a new thread if you have any specific questions and hopefully somebody will provide the answer you seek.

Good luck.
 

Users who are viewing this thread

Back
Top Bottom