Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record in use and File in use errors
Message
From
18/07/2006 05:43:53
 
 
To
17/07/2006 13:52:05
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 6
OS:
Windows XP SP2
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01136694
Message ID:
01137172
Views:
24
This message has been marked as the solution to the initial question of the thread.
John

I've replied to your request on the Foxpro Forum too :-)
...
>>
>>Aye but what BUFFERING do you have. If TABLE buffering then the fact that somneone has it open for browsing would preempt a delete attempt by another. wouldn't it?
>
>I had each form set up to use Pessimistic buffering, but have changed it to Optimistic buffering. I'm not sure if that's all I need to do, but things seem to be working now. Granted, they haven't done all that much testing on it since that change, but two batches of invoices posted error-free. Fingers crossed...

I was referring more to Table or Record buffering (both can be optimistic or pess.)

>
>>Also, your code has no provision for actually testing for another user having the record before attempting to delete it.
>
>True. What kind of code could I use to see if another user is using a table? Or to see if another user is using the current record? Again, sorry if these are basic questions, but I'm nowhere NEAR as experienced in VFP as 99% (or more) of the people here.
If RLOCK()    && locks the record if successful so no contention with another user
*   Do your updating
    UNLOCK
Endif
Similarly FLOCK() can lock the whole table but is less desirable as other users can't do updates at the same time till it's released.

You must see Record Locking in Help. This is fundamental when it comes to multi-user access where updating is involved.

Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform