Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here


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

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

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

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 -->

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 ?

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

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

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

Bye, Olaf.

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

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

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

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.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close