Microsoft KB Archive/139873

= PRB: Import Wizard's Scan Option Doesn't Scan Beyond Record 50 =

Article ID: 139873

Article Last Modified on 2/10/2000

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition

-



This article was previously published under Q139873



SYMPTOMS
After you select the Scan All Records option in the Import Wizard, only the first 50 records are actually scanned.



STATUS
Microsoft is researching this behavior and will post new information here in the Microsoft Knowledge Base as it becomes available.



MORE INFORMATION
By selecting the Scan All Records option in the Import Wizard, you might assume that the data is scanned and the structure of the file being imported is verified before the import actually occurs. This is not the case.

Steps to Reproduce Behavior
CAUTION: For the purposes of this demonstration, you should close all critical data and applications other than Visual FoxPro to ensure that the results of this demonstration have no effect on other data or applications should an error occur.

This demonstration requires that the Customer table from the Testdata database be present, intact, and available for your use. To demonstrate that the above situation is actually what the Import Wizard is doing, follow these steps:

 Use the Customer table from the Testdata database.  In the Command window, enter the following line of code: COPY TO C:\TESTTEXT.TXT TYPE DELIMITED  Open Testtext.txt in Notepad. If your text is wrapping, turn Word wrap off. Scroll down to the 51st record, the first field of which should be Merep, and remove the first comma (not the quotation mark) on that line. This damages the structure of the text file to be imported. Save and close the file. On Visual FoxPro's Tools menu, click Wizards, and then click Import.</li> Click the three-dot button located next to the Source File text box.</li> Locate Testtext.txt on your hard disk, select it, and then click OK.</li> Click the Next button in the Import Wizard dialog box. Note that the Status bar now reads:

Record: 1/50

This indicates that the first 50 records are intact.</li> Click the Option button.</li> In the Import Wizard Options dialog box, click Scan All Records, and then click OK.</li> Click Next, click Next, and then click Finish in the Wizard's dialog boxes. You may receive an error that indicates that the application has performed an illegal instruction and will be shut down. The point of this exercise was to demonstrate the fact that the Import Wizard never scanned the text file being imported. The 51st record was damaged, and the Import Wizard only displays the first 50 records.</li> Browse the newly created table, and go to record 51. The data will not have been imported properly. Close the table.</li>  In the Command window, enter the following line of code to erase the table you created: ERASE TESTTEXT.DBF </li></ol>

To further demonstrate the fact that the Import Wizard doesn't scan the text file being imported, perform the following steps:


 * 1) Using Notepad, edit Testtext.txt, and repair record 51 by inserting the comma that was removed earlier.
 * 2) Move up to record 49 and remove the first comma. The first field in this record should be MAGAA.
 * 3) Save and close the file.
 * 4) On the Visual FoxPro Tools menu, click Wizards, and then click Import. Then click the three-dot button next to the Source File text box.
 * 5) Locate Testtext.txt on your hard disk, select it, and then click OK.
 * 6) Click Next. You will receive an error stating the records in this file do not appear to be delimited by commas or tabs and the record lengths are variable. Fixed-length format will be used by default. This time, you did not tell the Wizard to scan all records. The damaged record was within the first 50 records and was automatically detected by the Wizard, so it displays the error message.

Additional query words: VFoxWin import fail

Keywords: KB139873

-

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

© Microsoft Corporation. All rights reserved.