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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to programmatically change codepage?

Status
Not open for further replies.

Nifrabar

Programmer
Mar 16, 2003
1,343
NL
Hi!
I found that in an application with holds tables with all CP 1252 a few tables with cp 850.
Can I change that 850 to 1252 programmaticly?

I know my client is quit often placing back back-ups. So just once changing the tables cp does not work.
TIA
-Bart
 
Bart,

There's a little program called CPZERO.PRG that will do what you want. It only works on one file at a time, but you could easily write some code that loops through all the tables in a given directory or DBC.

You'll find a copy of it in Tools/CPZERO folder, in your VFP folder.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Hello Mike,
Thanks for your information. In fact I already found the way to that cpzero prg. But I just wondered if there might be a single function within VFP which might do the alteration of the cp.
-Bart
 
No, there's no single function that will convert an entire DBF, as far as I know. You can use CPDBF() to find the existing code page. And CPCONVERT() to convert a single string. But nothing else that does what you want.

Presumably, that's why someone wrote CPZERO.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro tips, advice, training, consultancy
Custom software for your business
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top