Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Rlock() Weirdness
Message
From
19/08/1999 15:53:08
 
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00255251
Message ID:
00255503
Views:
12
>I have a free table (VFP6/SP3) with 4 records in it. At app startup, I want system1 to get a record lock on record1, system2 to get a record lock on record2, etc. I opened a dummy VFP session, opened the table shared, and rlock(1) at the command window to rlock for that session. Then I ran the code below on a secord VFP session, and it locks records 2 and 3. Can someone help me with my logic here? I want to limit the table to 4 records for 4 VFP sessions. Help?
>
>clear
>set reprocess to 2 automatic
> if !used('safety')
> use safety in 0 shared
> endif
> select safety
> locate for rlock() = .t.
> if !found()
> rlock(recno())
> else
> continue
> endif
>
>
>Thanks

After you do a LOCATE and didn't find anything, the record pointer is sitting at EOF(). You can't lock a record unless oyu are sitting on one.
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform