If you read carefully Cetin's answer you may solve the puzzle. If you get 5 from FERROR() the wrong path or file name possibility is eliminated.
What is left is:
- Your dbf is already open exclusively.
- You issue FOPEN() for write access
Note that FOPEN() with a second parameter 1,2,11,12 is the equivalent of USE ... EXCLUSIVE
Doru