>When we work with foreign clients we often need to change
>codes pages of all projects components, tables, forms, classes
>Usually we open these objects like tables and do copy myform.scx with cdx as newcodepage. It works for all, for reports, forms, classes, tables.
>Later we replace old forms, ... with new variants
>But when we do same for the database
>for example
>copy mybace.dbc with cdx as newcodepage, we get 3 files, like it should be for database
>.dbc, .dbt , .dcx. But when we move these files for the plcae of old and try to open database, it says, it is not database.
>Really, this this not problem for us, becase we have program for creating new databse from scratch, which takes in exe variant codepage from config.fpw, I just curious, why is such anomaly for database container.
Vladimir,
A database has bit 2 set in byte offset 28.
Table Flags
0x01 file has a structural .cdx
0x02 file has a Memo field
0x04 file is a database (.dbc)
With 'copy to' it loses 0x04 flag. Manually edit it. ie:
DO HOME()+'tools\hexedit\hexedit' WITH 'mynewdbc.dbc'
Change 2nd row, C column value from 03 to 07.
PS: You could do it programmatically too :
lcFile='myNewDBC.dbc'
handle=fopen(lcFile,12)
=fseek(handle,28)
=fwrite(handle,chr(0x07),1)
=fclose(handle)
And also you could directly poke your codepage value to byte offset 29 after you get the correct value from home()+'tools\cpzero\cpzero.prg'. Or you might use cpzero to do it.
Cetin