Microsoft KB Archive/105421

From BetaArchive Wiki

FIX: IMPORT Truncates Character Fields from .WK3 File

ID: Q105421

2.5x 2.60 | 2.5x 2.60

MS-DOS    | WINDOWS

kbprg kbfixlist kbbuglist The information in this article applies to:

  • Microsoft FoxPro for MS-DOS, versions 2.5x, 2.6
  • Microsoft FoxPro for Windows, versions 2.5x, 2.6

SYMPTOMS

Using the IMPORT command to import a Lotus 1-2-3 WK3 worksheet into FoxPro truncates any character-based fields to 8 characters.

RESOLUTION

To work around this problem, create a new structure for the file to be imported, and use the APPEND FROM command to import the data. For the example shown below under "More Information," issue the following commands:

   CREATE TABLE sheet1.dbf (alpha C(25))
   APPEND FROM "SHEET1.WK3" TYPE WK3

For more information about creating tables through the FoxPro user interface, see the "New" section of the chapter devoted to the File menu in the "User's Guide." APPEND FROM is designed to add records to the end of the table in the current work area. For more information about APPEND FROM, see the "Language Reference" manual. The relevant section of the "Database Menu" chapter in the "User's Guide" explains how to append records to a table using the FoxPro user interface.

STATUS

Microsoft has confirmed this to be a problem in the Microsoft products listed at the beginning of this article. This problem was corrected in FoxPro 2.6a for Windows and MS-DOS.

MORE INFORMATION

Steps to Reproduce Behavior

1. Open Excel. In cell A1, enter the twenty-six letters of the English

   alphabet. Copy and paste this string into the next 9 cells in column A.
   You now have the equivalent of a one-column table consisting of 10
   records.

2. From the File menu, choose Save As. Under Save File As Type, select WK3.

   Give the sheet the name SHEET1.WK3, and save it to disk.

3. Open FoxPro. In the FoxPro Command window, issue the following command:

      IMPORT FROM "SHEET1.WK3" TYPE WK3

FoxPro will report that ten records were imported. Browse the new table opened in the current work area, and note that the 26 characters have been truncated to 8. Display the structure of the table and note that only 8 bytes have been allocated to the width of the field. Additional reference words: FoxWin FoxDos 2.50 2.50a 2.50b 2.60 fixlist2.60a buglist2.50 buglist2.50a buglist2.50b buglist2.60 KBCategory: kbprg kbfixlist kbbuglist KBSubcategory: FxinteropSpread

Keywords          : FxinteropSpread kbbuglist kbfixlist
Version           : 2.5x 2.60 | 2.5x 2.60
Platform          : MS-DOS WINDOWS
Solution Type     : kbfix

Last Reviewed: October 16, 1997
© 1999 Microsoft Corporation. All rights reserved. Terms of Use.