Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Copying Records
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00166624
Message ID:
00166635
Views:
22
>>Please excuse this NEWBIE question, because I am sure the answer is very simple, but i cannot for the life of me figure out how to do this:
>>
>>How does one copy all the records from one VFP6 table into another identicaly structured table??

If the two tables have the same field names, you could:

USE (cTargetDBF)
APPEND FROM (cSourceDbf)


This will work regardless of the order of fields in the table. If the fiedls occur in the same order with the same types, but with different field names, you could:

USE (cSourceDBF)
COPY TO TEMP.TXT TYPE SDF
USE (cTargetDBF)
APPEND FROM TEMP.TXT TYPE SDF
ERASE TEMP.TXT


If you needed to reorder/rename fields, you could do a SQL Select from the source table to an intermediate table or cursor to rename/reorder the fields, and then do an APPEND FROM the cursor/table created by the SQL Select.

There are literally dozens of approaches available to do the same thing...


>>
>>I have tried the Copy and Append commands, but I must be getting my syntex wrong because I get error, and HELP has been useless so far.
>>
>>TIA,
>>Dan
>
>PS. Also, how is the best way for one to copy all records from a FPW database
>into an identically structured (well, the fields are the same types, etc) to
>a VFP6 table in a Database??
>
>Thanks Again,
>Dan
EMail: EdR@edrauh.com
"See, the sun is going down..."
"No, the horizon is moving up!"
- Firesign Theater


NT and Win2K FAQ .. cWashington WSH/ADSI/WMI site
MS WSH site ........... WSH FAQ Site
Wrox Press .............. Win32 Scripting Journal
eSolutions Services, LLC

The Surgeon General has determined that prolonged exposure to the Windows Script Host may be addictive to laboratory mice and codemonkeys
Previous
Reply
Map
View

Click here to load this message in the networking platform