Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Problem w/ Multi-User access of shared table
Message
From
03/11/2000 16:26:27
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00437694
Message ID:
00437851
Views:
34
>In the development environment using VFP 5.0 (old, I know :^Q), the access to a shared table seems to work, but using the production .EXE I've had problems. For example, I have a system shutdown option which polls my KEYUSER table to see if any users are currently in the system. If users are active, it lists them to the SysAdmin user. For some reason, the SysAdmin user's instance of the table still showed the user as active after the user had exited the system (which deletes the user record). Somehow, my system did not see the record as deleted.
>
>Any ideas as to why? How are changes to a shared table relayed to concurrent users? Is there any difference in how the runtime version does it vs. std. version?

Sounds like you need to bone up on multi-user access in VFP. :-) The most important point is that there is no mechanism in VFP that automagically "relays" changes back to all users that have the table open. Each user must requery/poll the table to make sure they have the latest information.

Ultimately, you need to obtain a file lock with FLOCK() to be assured of having the most recent information. This technique dates back to the dBASE days. So, you can get the FLOCK(), refresh your control(s), UNLOCK and you're up to date.

If you're buffering your table access, or using views, there are other options available. Check your documentation on these topics.
Regards. Al

"Violence is the last refuge of the incompetent." -- Isaac Asimov
"Never let your sense of morals prevent you from doing what is right." -- Isaac Asimov

Neither a despot, nor a doormat, be

Every app wants to be a database app when it grows up
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform