Limiting # of Open Databases

EndersG

Registered User.
Local time
Today, 11:23
Joined
Feb 18, 2000
Messages
84
I have a database that resides on a shared network so that many users of the database can open it up and use it simultaneously. However, I want to limit the number of users who can use it to only 5. So that when a 6th user wants to use it he will get a MsgBox that reads "The maximum number of users are currently using the database. Please wait until someone logs off." Do I have to write something in code to accomplish this? I beleive I start somewhere with the DBEngine.Workspaces(i).Database(i) however I'm not sure how to go about it. Can someone out there help?
 
This might be to simple, but you could set up a table in the back end for number of users. Then in the opening form of the frontend database, check the value in the number of users table. If the value equals 5 then give the user a message box and quit the database.

I hope this helps.

Matthew
 
Can't put my hand on the article now, but we found something on the MS knowledge base. Do a search on limiting users. It entailed opening the back-end database as ADO. I believe the code reads the .LDB file. I am currently testing the code now. One thing I noticed, a user is not considered using the database unless they are in a form/query/report that interfaces with a table. Just sitting at a switchboard/menu does not make them an active user. Hope this helps.

Bill C.
 

Users who are viewing this thread

Back
Top Bottom