Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Multiuser checking problem
Message
De
20/05/1998 09:47:57
 
 
À
20/05/1998 03:33:15
Thian Li Choo
Malitnet Group of Companies
Kuching, Malaisie
Information générale
Forum:
Visual FoxPro
Catégorie:
Client/serveur
Divers
Thread ID:
00100470
Message ID:
00100524
Vues:
17
>Dear All,
>
>In order to control each User ID can only be used by one user, my program save the UserID and update to the table while the user logging in. The record will be deleted when the user log out from the main screen.
>
>I encounter the problem if the system is interrupted by power failure or illegal operation... which is improper shutdown without exit from the main screen. The User Id record still in my table. In order to delete this record, I have to access to the database and delete this record before I can use the similar user Id.
>
>From the above problem, is there any other methods which I can used to control each user id can only be used by one person? Or delete the record in the table if the program is not quit from the main screen (Because my delete procedure is code in main screen - destroy event)
>
>Thank you very much for your advise and help.
>
>
>Regards,
>Miss Thian


I had this same problem. My workaround is to use low level file creates. I have a subdirectory of my app called users. When a user logs in, I use FCREATE() to create a file with the users network login id and open it read only. When the user exits the app, I close the file and delete it. Now if a user reboots the PC or some other failer causes in the app to terminate abnormally, the file is automatically closed when the connection is lost. When the app starts and finds that a file already exists with the user id name it tries to delete it. If it can delete the file then the file is deleted and a new is created and to world goes on. If the file cannot be deleted, then another person is in with that ID and the app returns an error form. I use the files inorder to produce a list of all current users. I have a meothod on my user form that does an ADIR() of the user directory. loops through the array attempting to delete the files and those files it cannot delete, it resolves the user id into a long name and displays the results in a list box. I also display the date and time the user got into the app.

Hope this helps
Fred Lauckner

You know, it works on my computer. I don't know what your problem is.

.Net aint so bad.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform