PRB: "SQL: Cannot Locate Table" Message w/ Modify View Command (195585)
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
- Microsoft Visual FoxPro for Macintosh 3.0b
- Microsoft Data Access Components 2.5
This article was previously published under Q195585 SYMPTOMS
After issuing a Modify View command, the following message displays:
SQL: Cannot locate table.
Depending on the version of Visual FoxPro, after you click OK, one of the
following occurs:
Visual FoxPro 3.0 or 5.0:
The View Designer opens without any fields
displaying in the Selected Fields list and
displays the available fields in the Available
Fields list of the Filter tab with the format
DATABASE_TABLE.FIELD rather than table.field.
Visual FoxPro 6.0:
The View Designer does not open. CAUSE
This behavior is caused by incorrectly referencing a database in the CREATE
SQL VIEW command used to create the view.
The error occurs when using the following syntax to create a remote SQL
VIEW, using a Visual FoxPro database and table as the remote data source:
CREATE SQL VIEW MY_SQL_VIEW REMOTE CONNECT MYREMOTE ;
AS SELECT FIELD_1, FIELD_2, FIELD_3 ;
FROM database!table ;
ORDER BY table.field
The error also occurs when using the following syntax to create a remote
SQL VIEW, using a SQL Server table as the remote data source:
CREATE SQL VIEW MY_SQL REMOTE CONNECT MYREMOTE ;
AS SELECT FIELD_1, FIELD_2, FIELD_3 ;
FROM database.owner.table ;
ORDER BY table.field
RESOLUTION
Here are two resolutions:
- Use the View Designer.
-or-
- If programmatically creating the remote SQL VIEW, check the syntax of
the command used to create the remote SQL VIEW.
The correct syntax for creating a remote SQL VIEW, using a Visual FoxPro
database and table as the remote data source follows:
CREATE SQL VIEW MY_SQL_VIEW REMOTE CONNECT MYREMOTE ;
AS SELECT FIELD_1, FIELD_2, FIELD_3 ;
FROM table ;
ORDER BY table.field
The correct syntax for creating a remote SQL VIEW, using a SQL Server
table as the remote data source follows:
CREATE SQL VIEW MY_SQL REMOTE CONNECT MYREMOTE ;
AS SELECT FIELD_1, FIELD_2, FIELD_3 ;
FROM database.owner.table table ;
ORDER BY table.field
Modification Type: | Minor | Last Reviewed: | 3/2/2005 |
---|
Keywords: | KbClientServer kbDatabase kbprb kbSample kbSQLProg KB195585 |
---|
|