Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to lock or excusively use database
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00365079
Message ID:
00365090
Views:
15
>I have execute file call ac.exe, I want to make this exe only single user can use . How to make exe to single user environment . In login form ie ok button and cancel button. In ok button, I do set the public
>variable multi_user to "N" as belows:-
>
>Multi_user = "N"
>then In the Ok Button check :-
> If Multi_user ="N"
> set exclusive on
> else
> set exclusive off
> endi
>
>I test run, Two persons still can get in
>then i try the other ways. I put same code into the Main.prg, Well I works. It come out the message : Access Denied. But the problem the message box have three buttons ie cancel, ignore, help. I try to click ignore... It let me into the program.... Why

Just because you SET EXCLUSIVE ON does not mean that two people cannot run the program at the same time. You will not get a collision until one or the other tries to use a table that is already in use.

If there is a shared drive where the data resides, you could write a file out that indicates the user is logged in, or lock a record in a table (logon.dbf) in your app and deny access to anyone else when they attempt to log in.

HTH
Wayne Myers, MCSD
Senior Consultant
Forte' Incorporated
"The only things you can take to heaven are those which you give away" Author Unknown
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform