Discussion:
DBF Files DELETED When PACK
(too old to reply)
DrWai
2005-09-15 02:27:08 UTC
Permalink
I found that VFP 6.0 would delete 'some' DBF files when PACK statement
is executed. Then, "File does not exists" error occurs.

However, this problem does not delete all my DBF files but just some of
them. I still cannot find its pattern.


Any idea?

Thanks.
Paul
2005-09-15 10:17:53 UTC
Permalink
Post by DrWai
I found that VFP 6.0 would delete 'some' DBF files when PACK statement
is executed. Then, "File does not exists" error occurs.
However, this problem does not delete all my DBF files but just some of
them. I still cannot find its pattern.
Any idea?
Well a PACK does something like this:

COPY TO tempdbf FOR NOT DELETED()
DELETE originaldbf
RENAME tempdbf TO originaldbf

Could it be that there is something odd about your temp folder?
--
Paul
Dan Freeman
2005-09-15 16:18:41 UTC
Permalink
Probably a user rights issue. There is some deleting and recreating going on
during a pack, but only if the table is large enough to warrant it IIRC.

Dan
Post by Paul
Post by DrWai
I found that VFP 6.0 would delete 'some' DBF files when PACK
statement is executed. Then, "File does not exists" error occurs.
However, this problem does not delete all my DBF files but just some
of them. I still cannot find its pattern.
Any idea?
COPY TO tempdbf FOR NOT DELETED()
DELETE originaldbf
RENAME tempdbf TO originaldbf
Could it be that there is something odd about your temp folder?
DrWai
2005-09-27 16:28:27 UTC
Permalink
Thanks for your reply. I have already find the pattern...for example:

- Create a table at c:\temp1\temp2\abc.dbf
- Append a record and then delete it
- Change the attribute of folder temp2 to invisible (hidden)
- Open the table again and then PACK
- Error "File Does Not Exist" should be prompted now

Paul, you are right...I found the temp file survived in the temp
folder. But, the problem is that PACK could not restore/rename the temp
file back to original, if ITS PARENT FOLDER IS HIDDEN.

Any suggestion? Or I need to write PACK step by step?
^^"
DrWai
2005-09-27 16:32:23 UTC
Permalink
As I posted in this forum under another topic, FoxPro seems have
problem on handling hidden file...try this

- Create a plain text file c:\temp\abc.txt
- Set it to invisible
- Type command SET TEXTMERGE ON
- Type command SET TEXTMERGE TO c:\temp\abc.txt ADDITIVE
- Access denied error occur

Loading...