Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying table from one dbc to another
Message
From
05/01/2005 04:46:56
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
05/01/2005 02:38:48
Randy Riegel
Zimish Contracting
Ohio, United States
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
SAMBA Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00974294
Message ID:
00974307
Views:
24
>I'm trying to copy a table to one dbc to another using the command:
>
>
>use mytable.dbf
>select mytable
>copy to "mytable2.dbf" database "test.dbc" with cdx
>
>
>Everything copys fine to the new database container but I lose the formating of the fields. Is there a special way to copy tables from one DBC to another? Or a utility to do it for me?
>
>Randy

Randy,
You could get/set them using dbgetprop()/dbsetprop() - most of them, readonly ones need alter table, create trigger etc commands. afields() also provides limited version of transformation.
Alternatively with gendbc generate programmatic version of your 'old' database, open 'new database, execute MakeTable_tablename part of generated code and then append from old. You might as well just 'steal' the dbsetprop()s from that code. This would be easiest in most cases.
Hacking old.dbc is another way but I don't suggest unless you know what you're doing.
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
Reply
Map
View

Click here to load this message in the networking platform