Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Error # 108:File is in use by another user?
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00506778
Message ID:
00506858
Views:
17
I am using record locking when I edit records. Do I need to lock the file when I append a blank record? How about if I change the code to do a SQL Insert?

According to the VFP docs, "FLOCK( ) returns true (.T.) if the table is successfully locked and returns false (.F.) if the table or a record in the table is already locked by another user." So, since I have other users with records locked for editing, I will not be able to lock the file to append a blank record.

>>NO. This is code that has been converted from FP 2.6. It is has been working OK for years. The only other possibility is a conflict between FP 2.6 & VFP 6.0, since both the old and converted apps are adding (and editing) the data. But, they are both adding and editing data in several databases. Only one database is having this problem.
>>
>>
>>>>I am occasionally getting "Error # 108:File is in use by another user" when a user attempts to add a record to a database. The code that is generating the error is "APPEND BLANK". The code is in a VFP 6.0 SP 5 EXE. The user is running WinNT 4.0. The database is on an NT server. Has anybody seen this problem?
>>>>
>>>>Thanks in advance.
>>>
>>>Are you using a record locking strategy or table buffering when adding records to the table?
>
>I would issue an FLOCK() command on the table before the append blank and then an UNLOCK when you are done. You will have to have code in place for when the table cant get locked. This is just one method, but it may help to understand if that Table is truely being used and trap for it, so you can either wait some many seconds or abort the operation. But in a multi-user environment locking/buffering needs to be done.
Dennis Lindeman
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform