Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File lock issue (help)
Message
 
À
30/05/1997 15:32:27
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00034295
Message ID:
00034308
Vues:
30
>I have an application that allows a user to view and approve records
>in dbf A . When he approves them they are transferred to data
>file B on a server by means of:
>
>use file b:
>append from file a:
>
>Periodically a user prints the transactions that accumulate in file
>B and clears it out, putting the records in an archive file C.
>
>use file b:
>do printing
>use file c:
>appe from file b:
>use file b:exclusive
>dele all
>pack
>use
>
>
>During the moments of printing the first user tried to append records
>to the print file (B) and got an error causing the exe to blow up.
>
>How do I control this situation? Can I tell B is in use and stop
>the first process until it is clear?
>
>Thx (A LOT) in ADV
>Chris

Chris,
Assuming that the steps of printing B, appending B to C and ZAPping B are ALWAYS performed together, I would use B exclusively, make a copy to a temporary cursor (or table for security) and then ZAP B. This would allow users to go back to adding records to the "new" B file. Use the COPY of B exclusively for printing and appending onto C. One warning: Be sure your copy is a REAL copy, not just a "USE AGAIN" of B.

Robert DOES have a point, however. You could reduce all of this copying by using flags. Printouts, counts, etc. would be fast if there was an index on the flag field. (Of course, we all end up working on systems either planned by someone else or by ourselves before we "Really Learned How to Do It")

As for telling if B is in use, trap any error message when trying to USE B exclusively. Either the command works or you get an error message and can cause the user to exit gracefully.

HTH
Barbara
Barbara Paltiel, Paltiel Inc.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform