FIX: COPY TO Incorrectly Copies All Fields to New DatabaseLast reviewed: October 20, 1997Article ID: Q115264 |
2.60
WINDOWS
kbprg kbfixlist kbbuglist kbcode
The information in this article applies to:
SYMPTOMSAfter you issue a SELECT-SQL command that selects specific fields from a table into a cursor, the COPY TO command will incorrectly copy ALL of the fields from the original table into the new table. NOTE: This also occurs with a query produced by the Relational Query By Example (RQBE) window.
RESOLUTIONThere are two workarounds you can use to get the desired results. Either workaround results in table TEMP1 correctly containing only the CNO and CITY fields.
Workaround 1Send the results of your SELECT-SQL command to a table rather than a cursor. For example:
***Begin Code Example*** SELECT cno,city from customer into TABLE temp1 USE temp1 BROWSE ***End Code Example*** Workaround 2Use SET FIELDS to have only CNO and CITY available. For example:
***Begin Code Example*** SELECT cno,city FROM customer INTO CURSOR temp SET FIELDS to cno,city COPY TO temp1 USE temp1 BROWSE ***End Code Example*** MORE INFORMATIONWhen the COPY TO command works correctly, it copies only the fields from the table in the current work area. The table in the current work area can be either a cursor or table. However, in FoxPro 2.6 for Windows, if the table in the current work area is a cursor, the COPY TO command copies all the fields that are in the cursor's source table. The following code example illustrates this behavior:
***Begin Code Example*** SELECT cno,city from customer into CURSOR temp COPY to temp1 USE temp1 BROWSE ***End Code Example***The TEMP1 table incorrectly contains all the fields that are in the CUSTOMER table.
|
Additional reference words: FoxWin 2.60 specific some few limit buglist2.60
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |