Microsoft KB Archive/114229

{| = PRB: "Syntax Err/Missing Operand" w/ .DBF Created in Other App =
 * width="100%"|

ID: Q114229

The information in this article applies to:


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

SYMPTOMS
If FoxPro opens a .DBF file that has invalid field names, a "Syntax Error" or "Missing Operand" error message will appear when you try to print or preview reports based on this table. A screen based on this table will generate the error message "Unrecognized phrase/keyword in command."

CAUSE
In FoxPro, legal characters for field names are A-Z, 0-9, and underscore (_). No other characters can be entered directly into a table setup. However, when you open a .DBF file that was created in an application that allows characters such as $, ?, and period (.), FoxPro will use the table with the illegal characters. However, any screens or reports based on this table will produce an error.

RESOLUTION
To correct this problem, either go into the database setup and change the field names to valid FoxPro names, or change the field names in the application in which the .DBF file was created.

Steps to Reproduce Problem
Additional reference words: FoxDos FoxWin 2.50 2.50a 2.50b 2.60 2.60a errmsg err msg KBCategory: kbother kberrmsg kbprb KBSubcategory: FxinteropDbase
 * 1) In Microsoft Excel, create a spreadsheet with these field names:
 * 2) Enter a few lines of test data.
 * 3) From the File menu, choose Save As.
 * 4) In the Save As dialog box, select dBASE IV from the Save File As Type box. Give the file a name with a .DBF extension.
 * 5) Start FoxPro and choose Open from the File menu.
 * 6) Under List Files Of Type, select Table/DBF, and open the file created in Microsoft Excel. Note that in FoxPro, the table setup will have the field names FIRST.NAME, LAST.NAME, and DOLLAR$.
 * 7) From the File menu, choose New.
 * 8) Select the Report button and choose New.
 * 9) From the Report menu, choose Quick Report, and then choose OK.
 * 10) From the Report menu, choose Page Preview. You will get one of these error messages: "Syntax Error" or "Missing Operand.".
 * }