Microsoft KB Archive/152647

= How To Copy a Table and Preserve Long Field Names =

Article ID: 152647

Article Last Modified on 10/15/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 3.0b for Macintosh

-



This article was previously published under Q152647



SUMMARY
This article describes how to copy a table and preserve long file names even though COPY TO and COPY STRUCTURE EXTENDED do not provide this functionality. It is possible to use AFIELDS and CREATE TABLE .. FROM ARRAY to accomplish the task. An example is provided below.



MORE INFORMATION
In order to preserve long file names, a database must be open and active when the CREATE TABLE command is issued. This causes the CREATE TABLE to create a database table, rather than a free table.

Example
Enter the following commands in the Command window: OPEN DATABASE HOME+"SAMPLES\MAINSAMP\DATA\tastrade" USE customer

nFldcount = AFIELDS(aFldarray)   && creates an array of fields

* The following command creates and opens a table with the structure * described in the array CREATE TABLE newcopy FROM ARRAY aFldarray

* If the data needs to be copied, you can then APPEND it  APPEND FROM customer

Additional query words: VFoxWin VFoxMac

Keywords: KB152647

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.