Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Multiuser / Networking / September 2004

Tip: Looking for answers? Try searching our database.

Limiting the number of users

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CQS Partners - 30 Sep 2004 06:07 GMT
I have a Frontend/backend system.  The frontend resides in the users
C: drive and the Backend Data is on a server share folder.

Is the way I can limit the number of online (active) users to say 5???

Phil
Nikos Yannacopoulos - 30 Sep 2004 09:11 GMT
Phil,

One way would be to use a single field, single record table in the BE to
hold the current number of users, and some simple code (or even update
queries fired by macros) behind the Open and Close events of a switchboard
in the front end (or even a dummy, hidden form just for the purpose, in lack
of a switchboard) to increase / decrease the number of users by 1 as they
log in and out. Not a very robust method, though, especially in that a
frozen FE will fail to update the BE of logging off, or "smart" users might
manually change the count in the BE to get in when they shouldn't etc.

Another way is to check for the existence of a lock file for the BE, and if
one is found, count the number of users in it. Obviously checking for the
existence only makes sense if the check is run outside of the FE (in another
.mdb or .exe), or if connection to the back end is done programatically
after the FE is loaded. This simple piece of code will do just that:

Sub count_users()
lockfile = "SomeDrive:\SomeFolder\Somefile.ldb"
If Dir(lockfile) = "" Then
   'no current user
   '
   Exit Sub
End If
Open lockfile For Input As #1
Line Input #1, usr
Close #1
cnt = 1
lusr = Len(usr)
For i = 2 To 186
   If Mid(usr, i - 1, 1) = " " And Mid(usr, i, 1) <> " " Then cnt = cnt + 1
Next
usrcount = cnt / 2
Debug.Print usrcount
End Sub

and it will work just as fine in a VB 6.0 exe as it will in Access.

HTH,
Nikos

> I have a Frontend/backend system.  The frontend resides in the users
> C: drive and the Backend Data is on a server share folder.
>
> Is the way I can limit the number of online (active) users to say 5???
>
> Phil
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.