PRB: Remote View to SQL Server with Logical Values

Last reviewed: December 16, 1996
Article ID: Q160912
The information in this article applies to:
  • Microsoft Visual FoxPro for Windows, versions 3.0, 3.0b, 5.0

SYMPTOMS

When you try to create a Remote View and try to filter based on logical .T. or .F., the following error could occur:

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

CAUSE

SQL Server stores logical values as 1 or 0.

RESOLUTION

Under the filter tab of the Remote View place a 1 or 0 for the Example criterion. If the desired records would contain .T. place a 1, and if .F. place a 0.

STATUS

This behavior is by design.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Open a Database Container with the command MODIFY DATA <dbc name>.

  2. Right-click in the Database Designer and select New Remote View.

  3. Select New View from the resulting dialog box and select a SQL Server Data Source from either the Connections or Available Data Sources.

  4. Select a table from the SQL Server database that has a logical field.

  5. Add all of the fields to the Selected fields.

  6. Select the Filter tab. Under Field name, choose the logical field.

  7. For the Criteria choose "Like" and under Example, enter ".T.".

  8. Run the Query and note that the error appears. By simply changing the ".T." to the number "1," you enable the query to perform correctly.


KBCategory: kbinterop kbprb
KBSubcategory: FxinteropOdbc
Additional reference words: 3.00 3.00b 5.00 vfoxwin kbdse



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: December 16, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.