Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem in opening file in vfp5.0
Message
 
À
23/07/1998 22:38:30
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00120831
Message ID:
00120834
Vues:
9
>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  && SUCCESSFUL

PROCEDURE errortrap
PARAMETER nerror
DO CASE
CASE INLIST(nerror,1705,3) && 1705-file access is denied, 3 File is in use
    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."
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform