PRB:Double Quotes in Remote View Filter Expression Cause ErrorLast reviewed: October 29, 1996Article ID: Q157628 |
The information in this article applies to:
SYMPTOMSIf the Filter expression of a remote view uses double quotes, then running or modifying the view causes the following error message:
Connectivity Error........invalid column name.... CAUSEMicrosoft SQL Server version 6.0 and up uses single quotes (') for string constants and double quotes (") for identifiers with spaces like "my table," "my column," and so forth. You must convert double quotes to single quotes in the View Designer, before the example constant is included in the SQL string.
WORKAROUND
Use Single Quotes (' ') instead of Double Quotes (" ").To make the example under "Steps To Reproduce Behavior" section work, change the Example Expression in the Filter tab to use Single Quotes ('B') instead of Double Quotes ("B"). If you are creating the Remote View programmatically then change the WHERE clause to use single quotes as follows:
CREATE SQL VIEW test; REMOTE CONNECTION "myConn"; AS SELECT Authors.au_id, Authors.au_lname, Authors.au_fname; FROM dbo.authors Authors; WHERE Authors.au_lname = 'B' STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
Connectivity Error [Microsoft][ODBC SQL SERVER DRIVER] [SQL SERVER]invalid column name 'B'The same behavior occurs if you create a remote view programmatically. So, instead of the above steps, you can issue the following commands to reproduce this behavior:
CREATE SQL VIEW test; REMOTE CONNECTION "myConn"; AS SELECT Authors.au_id, Authors.au_lname, Authors.au_fname; FROM dbo.authors Authors; WHERE Authors.au_lname = "B" |
KBCategory: kbprg kbinterop kbprb
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |