Microsoft KB Archive/221677

= FIX: A remote view is created in the SQL Upsizing Wizard with an invalid filter condition when you upsize a database that contains a local view and the local view uses the "==" operator in Visual FoxPro =

Article ID: 221677

Article Last Modified on 3/17/2005

-

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 Q221677



SYMPTOMS
You are using the SQL Server Upsizing Wizard to upsize a Visual FoxPro database. The database you are upsizing contains a local view that uses the '==' operator as a filter comparison criteria. When the view is upsized, the filter criteria remains unchanged. This results in a remote view with an invalid filter condition because the '==' operator has no meaning to SQL Server. The Criteria drop-down box in the View Designer will be blank for the condition that contained the '==' operator in the local view.



RESOLUTION
You can make the remote view functional again by modifying the remote view, clicking the Filter tab within the View Designer, and selecting the '=' operator from the Criteria drop-down box for the filter condition where the criteria is blank.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.

This bug was corrected in Visual Studio 6.0 Service Pack 3.

For more information about Visual Studio service packs, please see the following articles in the Microsoft Knowledge Base:

194022 INFO: Visual Studio 6.0 Service Packs, What, Where, Why

194295 HOWTO: Tell That Visual Studio 6.0 Service Packs Are Installed



Steps to Reproduce Behavior
 Create a new directory and set it as the default directory within Visual FoxPro.  Create the database, table, and local view by running the following code from a program (.PRG) file: CLOSE DATA ALL CREATE DATABASE 'TESTDBC.DBC'

CREATE TABLE 'USERTAB.DBF' NAME 'USERTAB' (USERKEY I NOT NULL, ;   USERID C(10) NOT NULL) SET COLLATE TO 'MACHINE' INDEX ON USERID TAG USERID ALTER TABLE 'USERTAB' ADD PRIMARY KEY USERKEY TAG USERKEY

CREATE SQL VIEW "V_USERTAB_USERID" ; AS SELECT USERTAB.USERID, USERTAB.USERKEY ; FROM TESTDBC!USERTAB WHERE USERTAB.USERID == ?USERTAB_userid

DBSETPROP('V_USERTAB_USERID', 'View', 'WhereType', 3) DBSETPROP('V_USERTAB_USERID', 'View', 'Tables', 'TESTDBC!USERTAB') DBSETPROP('V_USERTAB_USERID.userid', 'Field', 'KeyField', .T.) DBSETPROP('V_USERTAB_USERID.userid', 'Field', 'Updatable', .T.) DBSETPROP('V_USERTAB_USERID.userid', 'Field', 'UpdateName', ;   'TESTDBC!USERTAB.userid') DBSETPROP('V_USERTAB_USERID.userid', 'Field', 'DataType', "C(10)") DBSETPROP('V_USERTAB_USERID.userkey', 'Field', 'KeyField', .F.) DBSETPROP('V_USERTAB_USERID.userkey', 'Field', 'Updatable', .T.) DBSETPROP('V_USERTAB_USERID.userkey', 'Field', 'UpdateName', ;   'TESTDBC!USERTAB.userkey') DBSETPROP('V_USERTAB_USERID.userkey', 'Field', 'DataType', "I")  Run the SQL Server Upsizing Wizard. In step 1, select Testdbc.dbc, and then click Next. In step 2, select a SQL Server datasource suitable to use for an upsizing destination, and then click Next. When prompted, log into the SQL Server datasource.</li> In step 3, add the Usertab table to the Selected tables list, and then click Finish twice.</li> Click OK when the Upsize complete messagebox appears.</li> Close the project.</li>  Put the following in the Command Window: SET DATABASE TO Testdbc MODIFY VIEW V_USERTAB_USERID </li> Log in, and then click the View Designer Filter tab.</li></ol>

Results: <ol> The Criteria column is empty. No '==' or '=' operator appears.</li>  If you select View SQL within the View Designer, you will see: SELECT B01user.userid, B01user.userkey; FROM b01user B01user; WHERE B01user.userid == ?b01user_userid </li> The '==' is not a valid operator for a remote view to SQL Server, but still appears in SQL.</li> If you try to run the view and type in a parameter such as "XXX" you get an error as follows:</li></ol>

Connectivity error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '='.

Keywords: kbbug kbfix kbdatabase kbwizard kbvs600sp3fix KB221677

-

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

© Microsoft Corporation. All rights reserved.