PRB: "Syntax Err/Missing Operand" w/ .DBF Created in Other App

Last reviewed: June 28, 1995
Article 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.

MORE INFORMATION

Steps to Reproduce Problem

  1. In Microsoft Excel, create a spreadsheet with these field names:

    First.Name, Last.Name, Dollar$

  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."


Additional reference words: FoxDos FoxWin 2.50 2.50a 2.50b 2.60 2.60a
errmsg err
msg
KBCategory: kbother kberrmsg kbprb
KBSubcategory: FxinteropDbase


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 28, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.