Field Names in First Record Exported to Spreadsheet

Last reviewed: June 26, 1995
Article ID: Q109844
The information in this article applies to:
  • Microsoft FoxPro for Windows, versions 2.5, 2.5a, and 2.5b
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, 2.5a, and 2.5b

SUMMARY

When the COPY TO or EXPORT command is used to export a database to a spreadsheet file type, the first record (row) in the spreadsheet contains the field names of the source database.

MORE INFORMATION

This information applies to the following file types:

   DIF, MOD, SYLK, WK1, WKS, WR1, WRK, XLS

Steps to Reproduce Behavior

  1. Start FoxPro.

  2. Create and run a program with the following code to create Microsoft Excel spreadsheets using the COPY TO and EXPORT commands:

          CREATE TABLE test (charfld C(20), numfld N(10))
          INSERT INTO test (charfld, numfld) VALUES ('Chris Tester', 1234)
          COPY TO copytest.xls TYPE XLS
          EXPORT TO exp-test.xls TYPE XLS
    

  3. Start Microsoft Excel and load COPYTEST.XLS, then EXP-TEST.XLS.

In each spreadsheet, note that the first row contains the field names "charfld" and "numfld." The second row contains the data, "Chris Tester" and "1234."

NOTE: The field names created by FoxPro for Windows are lowercase. The field names created by FoxPro for MS-DOS are uppercase.


Additional reference words: FoxDos FoxWin 2.00 2.50 2.50a 2.50b column 1st
KBCategory: kbprg
KBSubcategory: FxinteropSpread


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: June 26, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.