Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Record in use and File in use errors
Message
From
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:
01137007
Views:
16
>>Here's a little additional info, in case it helps. And man, do I need help...
>>
>>One user is in my Orders form adding new orders and another is in my Invoice form billing older orders. The person who is entering new orders is doing nothing with the orders that the person doing the invoicing is invoicing.
>>
>>The person who is posting invoices is getting the following error message:
>>
>>Program : PROCEDURE FORM1.PAGEFRAME1.PAGE4.CMDPRINT.CLICK I:\PONTOTOC\INVOICES.SCT
>>Line : 365
>>Error # : 109
>>Message : Record is in use by another user.
>>
>>Here is the code that's generating the error in my Invoicing form. I'm scanning through my order header file (ORD_HEAD) to see if there are any remaining detail lines in ORD_LINE. If there aren't, I'm deleted the record in ORD_HEAD:
>>
>> sele ord_head
>> go top
>> scan
>> if !indexseek(ord_head.order_no,.f.,"ord_line","order_no")
>> dele
>> endi
>> endscan
>>
>>Line #365 (the line of code that's causing the error) is DELE.
>>
>>The table ORD_HEAD is opened in the Data Environment of my Invoices form with the Exclusive property set to .f.. The table ORD_HEAD is also opened in the Data Environment of my Orders form with the Exclusive property set to .f..
>>
>
>John
>
>FWIW
>
>>What could be causing this error? The person who's entering orders is not entering the order that the person who's posting invoices is deleting through the posting process, so the record SHOULDN'T be "in use" by anyone else.
>
>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...

>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.

>Is there any RI on the order lines table that might prevent deleting their parent?

Nothing in RI at all.

Thanks!

John
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform