PRB: Data Environment Stores Paths as Relative Paths (229779)
The information in this article applies to:
- Microsoft Visual FoxPro for Windows 3.0
- Microsoft Visual FoxPro for Windows 3.0b
- Microsoft Visual FoxPro for Windows 5.0
- Microsoft Visual FoxPro for Windows 5.0a
- Microsoft Visual FoxPro for Windows 6.0
This article was previously published under Q229779 SYMPTOMS
If you develop a form with one or more tables in the data environment and the table in the data environment is on the same drive as the Visual FoxPro form, when the form is deployed to computers, the data environment looks on the local drive for the table, resulting in the following error:
Error instantiating cursor object. Could not find (table file name).
CAUSE
The data environment stores the path to the table as a relative path. For example, if a table used in the data environment is located in "F:\MyData" and the form is located in "F:\MyData\Forms," Visual FoxPro stores the path as "..\MyTable.Dbf" instead of storing the path as "F:\MyData\MyTable.Dbf." When a relative path is stored, Visual FoxPro looks for the table on the drive that the form is run from.
RESOLUTION
There are two possible resolutions for this problem. - The first is to manually edit the SCX file. To do this, use the following steps:
- Use the SCX file as a table, making sure to include the SCX extension. For instance, USE MyForm.Scx.
- Browse the SCX file. Double-click on the Class memo field and position the memo field window and the browse window so that both are visible.
- Scroll through the records in the browse window until the memo field window displays "cursor" (without the quotation marks).
- In the Properties memo field window, edit the CursorSource property so that it has the full path, not a relative path. For instance, "d:\MyDirectory\Data\MyTable.dbf" instead of "..\MyTable.Dbf." The CursorSource property can be entered with or without quotation marks. However, if the path contains spaces, quotation marks are required.
- Double-click the Properties memo field in the browse window.
- A second resolution is to create the form on a different drive than the one on which the tables are stored. Visual FoxPro stores the complete path in the data environment.
REFERENCESFor additional information on the data environment, click the article number below
to view the article in the Microsoft Knowledge Base:
128996 HOWTO: Assign Database Location Generically in Data Env
Modification Type: | Major | Last Reviewed: | 5/12/2003 |
---|
Keywords: | kbContainer kbCtrl kbDatabase kbprb KB229779 |
---|
|