Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why lock() fails.
Message
From
18/10/2001 14:11:37
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Why lock() fails.
Miscellaneous
Thread ID:
00570423
Message ID:
00570423
Views:
60
I have a forms with private data session.

Cursors are created in those forms load event with optimistics table buffering.
create cursor TEMPCURS from array aStru
cursorsetprop( 'Buffering', 5 )
Forms have a grid (invoice rows) based on this cursor.
This cursor has many relations to tables in LAN server set by SET RELATION command in grid column combobox init event.
There are a number of users in network and a number of forms in screen using
the same program.

I have a command
SET REPROCESS TO 30 SECONDS

in datasesson init.

Users can add rows to this cursor in grid and over-type combobox column contents.

I use the following command to store the entered data
SELECT TEMPCURS
IF LOCK()
  REPLACE mydata with relalias.myvalue
  unlock
 else
  messagebox('Lock Fails !!!' + str(recno()) )
  endif
Locking a temporary cursor must be always successful.
However, sometimes users get Lock Fail errors and recno() is -2

Why LOCK() command fails in this situation sometimes?
Andrus
Next
Reply
Map
View

Click here to load this message in the networking platform