Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determine number of users
Message
 
 
À
18/03/2002 11:01:39
Walter Meester
HoogkarspelPays-Bas
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00634094
Message ID:
00634114
Vues:
24
This message has been marked as a message which has helped to the initial question of the thread.
>Hi all,
>
>I know how to determine and limitting the number of concurrent users in a VFP database via record locks.
>
>But how can you limit the number of users when all data is on the SQL-server (thus the record lock strategy does not work here). How can this be as much bulletproof as we don't have any control over what a system administrator is doing. It should also handle crashed clients properly.
>

Walter,
You could use the same methodolgy and use a semaphore table to hold logged in user information.

You could store the user name, machine ID and datetime when the user logs in. When another user attempts to login, you could run a count on the current login records to determine if they are allowed in. The following rules could be applied:

1. If the user is already in the table under a different machine ID, you could assume they are attempting to login in twice and prevent them.
2. If it is the same machine ID and you have code in your application to prevent multiple instances of your application, you could assume they exited the application abnormally.

You could also have a timer built into your application that updates the login record at some interval. The login process could delete all "old" information before it runs the count so no users who had exited abnormally and simply left for the day would be included in yuor count.

All this processing could be included in a Login SP to centralize it on the server.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform