Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Avoid repeated values with more than two users
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
01322172
Message ID:
01322318
Views:
9
About Borislav code below:

=======================================
USE NewKey IN 0
IF NOT FLOCK([NewKey])
MessageBox([Somebody tries to add records right now, please try after a few seconds])
RETURN
ENDIF
=====================================

As far as I understood, there is a small chance 2 users are
saving the record at the same time. And also this event
will last just for a little while (correct me if I am wrong)

So instead I messagebox, is there a way that in case FLOCK( ) fails,
the software would wait a second and try it one or more times until it is sucessfully ?

(because maybe in a second the user would be already saved his record)

Moises
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform