Microsoft KB Archive/165307

= BUG: Incorrect WHERE Clause Shows in View Designer =

Article ID: 165307

Article Last Modified on 10/16/2002

-

APPLIES TO


 * Microsoft Visual FoxPro 5.0 Standard Edition
 * Microsoft Visual FoxPro 5.0a
 * Microsoft Visual FoxPro 6.0 Professional Edition

-



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.



Steps to Reproduce Behavior
  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  Right-click on the View and select Browse. Right-click on the View and select Modify. 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: kbbug kbprogramming KB165307

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.