BUG: Incorrect WHERE Clause Shows in View Designer (165307)



The information in this article applies to:

  • 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 Q165307

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 has confirmed this to be a bug in the Microsoft products listed at the beginning of this article.

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.

Modification Type:MajorLast Reviewed:10/16/2002
Keywords:kbBug kbProgramming KB165307 kbAudDeveloper