Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Anomaly of copy to with cdx as codepage
Message
From
29/04/2002 03:42:01
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
29/04/2002 03:09:15
Vladimir Zhuravlev
Institute of the Physics of Earth,Russia
Moscow Region, Russia
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00650255
Message ID:
00650261
Views:
23
>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
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform