Microsoft KB Archive/156582

= PRB: Opening Database Named IN.DBC as a Table Causes Error =

Article ID: 156582

Article Last Modified on 12/3/2003

-

APPLIES TO


 * Microsoft Visual FoxPro 3.0 Standard Edition
 * Microsoft Visual FoxPro 3.0b Standard Edition
 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



This article was previously published under Q156582



SYMPTOMS
Attempting to open a .dbc file named In.dbc as a table with the USE command causes the following error message to appear:

Expression is not valid outside of With/EndWith.



CAUSE
The USE command has an IN clause. In this case, Visual FoxPro cannot determine whether the word "In" is a clause of the command or the file name.



WORKAROUND
The following syntax successfully opens the .dbc file as a table: USE "In.dbc"



STATUS
This behavior is by design.



MORE INFORMATION
In this case, the syntax of the USE command is ambiguous. The USE IN command closes a table located in the specified work area. Since it is not clear that "In" is a file name, FoxPro treats it like a clause of the USE command.

When FoxPro interprets the USE command, it attempts to evaluate the .dbc file as a property. Since no such property exists, the error message appears.

Steps to Reproduce Behavior
  In the Command window, type the following code: CREATE DATABASE In     CLOSE DATABASE USE In.dbc  After the above error appears, click the Cancel button.  Type the following line in the Command window to open the database as a table: USE "In.dbc" 

Additional query words: kbdsd VFoxWin

Keywords: KB156582

-

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

© Microsoft Corporation. All rights reserved.