How to Use SET PATH to Control Which Table Opens FirstID: Q130603 3.00 WINDOWS The information in this article applies to:
SUMMARYVisual FoxPro uses SET PATH to determine which file opens first when multiple files have the same name and no database (.DBC file) is current. This behavior matches the behavior of prior versions of Microsoft FoxPro.
MORE INFORMATIONTo see this behavior, assume the following directory structure:
Directory MAIN contains two .DBC files (d_one and d_two). Both databases
are open, neither is current.
The d_one database contains a T_ONE.DBF table that resides in C:\MAIN\ONE.
The d_two database also contains a T_ONE.DBF table that resides in
C:\MAIN\TWO.
Given this scenario, no table is opened if the following command is issued:
This is because the current directory is MAIN where no table named "t_one"
resides, and no database container (.DBC file) is current. Visual FoxPro
looks for a free table named T_ONE.DBF in the current MAIN directory and
doesn't find one, so it generates this error:
However, if you had used SET PATH to set the path, Visual FoxPro would have
located the file in which ever directory occurred first. For example:
To guarantee that a particular table in a database container (.DBC file) is
opened, use Visual FoxPro's exclamation (!) symbol notation. For example:
However, if the t_one tables did not belong to a database container (.DBC
file), the exclamation (!) symbol notation could not be used. This behavior
is consistent with FoxPro versions 2.x. For tables that don't belong to a
Visual FoxPro database, you must use the FoxPro version 2.x method to open
a specific table:
Additional reference words: 3.00 VFoxWin
KBCategory:
KBSubcategory: FxprgTable
|
Last Reviewed: May 22, 1998 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |