PRB: Incorrect WHERE Clause Shows in View Designer

Last reviewed: June 3, 1997
Article ID: Q165307
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 5.0, 5.0a

SYMPTOMS

The SQL window in the View Designer shows an incorrect WHERE clause if the view is browsed in the database before it is modified. The field names are prefaced with the name of the view instead of the name of the table the view is based on.

RESOLUTION

When creating the view, preface the field names in the WHERE clause with the table name.

-or-

If the Browse window has already been opened, close it and close the view, then modify the view and the SQL WHERE clause will be correct.

STATUS

Microsoft is researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Run the following code to create a new database with a table and a view of that table.

          SET DEFAULT TO HOME()+"\samples\data"
          USE customer
          COPY TO new_cust
          CREATE DATABASE new_dbc
          ADD TABLE new_cust
          CREATE SQL VIEW test AS SELECT country, maxordamt ;
    
                FROM new_cust WHERE country="USA" and maxordamt>10000
          MODIFY DATABASE NOWAIT
    
    

  2. Right-click on the View and select Browse.

  3. Right-click on the View and select Modify.

  4. In the View Designer, click SQL on the View Designer toolbar.

Look at the WHERE clause. The field names are prefaced with the view name not the table name. The WHERE clause looks correct if the view is modified without browsing first.


Keywords : FxprgTable FxtoolOtherdes kbprg vfoxwin
Version : 5.0 5.0a
Platform : WINDOWS
Issue type : kbprb


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