PRB: FoxPro and Clipper Share the Same DBF Files on a NetworkLast reviewed: June 3, 1996Article ID: Q151841 |
The information in this article applies to:
SYMPTOMSRLOCK() will not function properly when a FoxPro Application and a Clipper Application access the same table simultaneously.
CAUSEBoth FoxPro and Clipper have their own Locking Mechanism. When applying a lock to a table file on the Network, the function FLOCK() can be recognized by both Foxpro and Clipper; it will return a TRUE (.T.) if the table is locked by any of the applications. The function RLOCK() returns a TRUE only if a particular record of a table is locked by the same application. In other words, if a record was locked by Foxpro, Clipper can still lock the particular record without an error, and it has the same behavior the other way around.
RESOLUTIONUse FLOCK() instead of RLOCK().
MORE INFORMATION
Steps to Reproduce BehaviorRun the following code in Clipper:
** <Table_Field> is a numeric field in a Table USE <Table_Name> SHARED GOTO TOP REPLACE <Table_Field> WITH 100 && Initial Value of <Table_Field> DO WHILE RLOCK() && Record is Locked by Clipper ? <Table_Field> WAIT Hit a Key ... TO M.temp ENDDOand Run the following code in FoxPro:
USE <Table_Name> SHARED GOTO TOP DO WHILE RLOCK() && Record is Locked by Foxpro REPLACE <Table_Field> WITH <Table_Field> + 1 WAIT Hit a Key ... TO M.temp ENDDO Expected BehaviorWhen the above code is executed by Foxpro and Clipper at the same time, the expected behavior is:
Actual Behavior
|
Additional reference words: 2.00 2.50 2.50a 2.50b 2.60 2.60a 3.00 3.00b
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |