Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

can not open in Fdos a copy of table, that i copied with VFP 9.0

Status
Not open for further replies.
Jan 20, 2007
237
US
Hi Guys,

i did a little form in vfp 9.0, to copy some records from a Fdos tables, so then i used the "cpzero utility" to make sure later, if i want to access that table from an Old Fdos application, i can read that table but no succesfully, as i am getting "NOT A DATABASE FILE"

So basically in my command button i have something like this

Code:
SET DEFAULT TO f:\mfg
USE eng_jobs IN 0 SHARED ALIAS eng_jobs
COPY TO "x:\closedb\closedj\120876.dbf" FOR job_no="120876"
DO CPZERO WITH "120876.DBF", 437

the file 120876.dbf is created in the folder specified with the records filtered by the "FOR" clause but when i am trying to open the file 120876.dbf from the Fdos, i get the error "NOT A DATABASE FILE"
i have understood that the "CPZERO" should pass the codepage parameter as it is the one needed for Fdos the codepage=437
can you guys guide me here or point to what is wrong ?
Thanks
 
If your goal is to open the DBF in VFP9, you already do so with USE.

You don't create a downward compatible file for FDOS, you create a free VFP9 table. You could try

[tt]COPY TO "x:\closedb\closedj\120876.dbf" TYPE FOX2X FOR job_no="120876"[/tt]
or
[tt]COPY TO "x:\closedb\closedj\120876.dbf" TYPE FOXPLUS FOR job_no="120876"[/tt]

Bye, Olaf.
 
Olaf,
Thanks man,

COPY TO "x:\closedb\closedj\120876.dbf" TYPE FOX2X FOR job_no="120876"

The above did the work i needed
now i can copy the file usng the vfp 9.0 application and later open it from the Fdos applocation.

Now the question is, why cpzero, does not work as i believe it should work ?

if i use cpzero, with the file copied with this code, COPY TO "x:\closedb\closedj\120876.dbf" FOR job_no="120876", then cpzero should assign codepage 437, isn't this code applied to the file 120876.dbf and should be readable in Foxpro Dos or not ?
maybe i am confused with cpzero, maybe i can only be used when using the "USE" command and not with the copy command as i did ? please clarify

Thanks in advance
 
I never had to cope with this stuff, but AFAIK cpzero just removes any codepage info from a DBF file.

Referring to the help you have to DO Cpzero.prg WITH "filename",437 to get it to codepage 437.

Though you should not need that as COPY TO ... AS 437 would generate the DBF with codepage 437 without needing to apply cpzero. The tool only changes the header bytes storing the codepage number anyway, data is untouched and not converted from one to another codepage.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top