Microsoft KB Archive/311155

= FIX: &quot;ODBC SQL Server Driver&quot; Error Message When You Use the MDAC 2.6 ODBC Driver from SP1 or SP2 =

Article ID: 311155

Article Last Modified on 9/26/2005

-

APPLIES TO


 * Microsoft Data Access Components 2.6 Service Pack 1
 * Microsoft Data Access Components 2.6 Service Pack 2
 * Microsoft ODBC Driver for SQL Server 2000 2000.80.380

-



This article was previously published under Q311155



SYMPTOMS
When you attempt to execute a SELECT statement with parameters by using the ODBC driver for SQL Server 2000 that is included in Microsoft Data Access Components (MDAC) version 2.6 Service Pack 1 (SP1) or Service Pack 2 (SP2), you may receive an error message similar to the following:

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

The following is the select statement used in this scenario: SELECT 'X' FROM Authors WHERE (?= 'Y') NOTE: There is no space between the parameter &quot;?&quot; and the &quot;=&quot; character.



CAUSE
This behavior occurs because the SQL Server ODBC driver that is included with MDAC 2.6 SP1 or SP2 may not parse the SELECT statement correctly.



RESOLUTION
A supported fix is now available from Microsoft, but it is only intended to correct the problem that is described in this article. Apply it only to computers that are experiencing this specific problem.

To resolve this problem, contact Microsoft Product Support Services to obtain the fix. For a complete list of Microsoft Product Support Services phone numbers and information about support costs, visit the following Microsoft Web site:

http://support.microsoft.com/default.aspx?scid=fh;EN-US;CNTACTMS

NOTE: In special cases, charges that are ordinarily incurred for support calls may be canceled if a Microsoft Support Professional determines that a specific update will resolve your problem. The usual support costs will apply to additional support questions and issues that do not qualify for the specific update in question.

The English-language version of this fix should have the following file attributes or later:

MDAC 2.6 SP1 Date       Version           Size     File name      Platform -- 11/07/2001 2000.080.0461.00  029,252  odbcbcp.dll      x86 10/30/2001 2000.080.0461.00  471,121  sqlsrv32.dll     x86 10/30/2001 2000.080.0461.00  090,112  sqlsrv32.rll     x86 MDAC 2.6 SP2 Date       Version           Size     File name      Platform -- 04/25/2002 2000.080.0617.00  029,252  odbcbcp.dll      x86 04/25/2002 2000.080.0617.00  475,217  sqlsrv32.dll     x86 04/25/2002 2000.080.0617.00  090,112  sqlsrv32.rll     x86



WORKAROUND
To work around this issue, use any of the following methods:  If possible, use MDAC 2.7. This issue does not occur with MDAC 2.7.

-or- Use MDAC 2.6 without any service pack.

-or-  Use the following SELECT statement instead of the statement described in the &quot;Symptoms&quot; section of this article: SELECT 'X' FROM Authors WHERE (? = 'Y') Note that in this SELECT statement, there is a space between the &quot;?&quot; parameter and &quot;=&quot; character. 



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

Keywords: kberrmsg kbqfe kbprb kbhotfixserver KB311155

-

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

© Microsoft Corporation. All rights reserved.