Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record locking in a SQL Select
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01228210
Message ID:
01229634
Views:
21
>>Hi John
>>
>>It doesn't matter if it's a UDF or a built-in VFP function. VFP always opens the tables again with different aliases while the query runs.
>>
>>recno is a built in function. Check the effects of the following:
>>
>>clear all
>>use sometable in a
>>select 0
>>select recno("sometable") from sometable
>>
>>You'll get 1 for all rows. The truth is you cannot be 100% sure what alias sometable will be in the query.
>
>Mike,
>I can't thank you enough for ruining my day. Here we thought we had it figured out and now you show us how wrong we were. I'm so glad you looked at this, otherwise we would have been in a heap of trouble when we sent our next update out all over the country. Talk about a bunch of bad phone calls.
>
>I guess the only way to do it in VFP is to get the recs with a SQL and then use the old scan loop to lock each one.
>
>Many thanks again,
>John.

While this does work, I'd be hesitent to rely on it:
SELECT *,RLOCK() FROM  sometable WHERE somecondition INTO CURSOR other
will lock records in sometable.
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform