>Hi,
>
> I had function to open vfp 5.0 dbf file exclusive mode or share mode. Because I need to ensure that it is open without any problem like access denied or file in use. Therefore, I had a DO WHILE .T. loop to ensure that it is check for problem, if so, try to open it until success. And I use a neterror() function to check for error like access denied. However,the loop seem to be in a deadlock, at first , it complaint of other using the file, however, when I close the file, it still report the same error.
>
> Please advise.
NO need for you to have a LOOP.
Try:
ON ERROR DO errortrap WITH ERROR()
SET EXCLUSIVE OFF
SET REPROCESS TO AUTOMATIC
USE pclevel IN 0 EXCLUSIVE
BROWSE
PROCEDURE errortrap
PARAMETER nerror
DO CASE
CASE INLIST(nerror,1705,3)
WAIT WINDOW 'File access is denied, RETRYING TO OPEN...' NOWAIT
RETRY
CASE nerror = whatsoever
DO anything
ENDCASE
HTH
JESS S. BANAGA
Project Leader - SDD division
...shifting from VFP to C#.Net
CHARISMA simply means: "Be more concerned about making others feel good about themselves than you are in making them feel good about you."