Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
'Pack' erases dbf file
Message
From
16/01/2004 07:54:30
 
 
To
16/01/2004 07:14:13
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00867417
Message ID:
00867428
Views:
17
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
Previous
Reply
Map
View

Click here to load this message in the networking platform