Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
'Pack' erases dbf file
Message
De
16/01/2004 07:54:30
 
 
À
16/01/2004 07:14:13
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Divers
Thread ID:
00867417
Message ID:
00867428
Vues:
18
Hi Michael

I suggest you change the pack routine to something like this, the code is NOT tested


PROCEDURE PAKFILE
LPARAMETER lcOriginalFile
USE (lcOriginalFile) EXCLUSIVE
COPY TO ('TEMP\'+lcOriginalFile) WITH CDX FOR !DELETED
ZAP
APPEND FROM ('TEMP\'+lcOriginalFile)
ENDPROCEDURE
<\PRE>

The COPY TO line will possibly crash your computer if you have a CDX corruption, but no harm is done! And, in practice it is a pack command plus backup in one as it is written here!

In stead of PACK YOURFILE you simply issue either DO PAKFILE WITH YOURFILE or =PAKFILE(YOURFILE)

>I have a VFP7 client application running on about 3 PCs (W98SE / WXP) against a shared VFP database located on a server within a large client network. Occasionally one user will run a program within the application to pack and reindex the data files within the database. To do this, of course, they request other users to sign off and then acquire exclusive use of the database and tables. The routine checks for exclusivity.
>
>Recently, this has caused several C5 crashes, probably at the program line that contains the command 'pack'. Upon then looking at the database, a dbf file has vanished (leaving its cdx and fpt files). This is at the least inconvenient(!) - at the most, potentially disastrous, as the system feeds the main factory trailer loading pallet picklist.
>
>It is possible that at the point that the routine is run, there is a mismatch between the cdx file and the dbf file (how can this happen?), but I am not sure.
>
>Any ideas?
>
>Mike
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform