Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

FIX: "ODBC SQL Server Driver" Error Message When You Use the MDAC 2.6 ODBC Driver from SP1 or SP2


View products that this article applies to.

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 "?" and the "=" character.

↑ Back to the top


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.

↑ Back to the top


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: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
				

↑ Back to the top


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 "Symptoms" section of this article:
    SELECT 'X' FROM Authors WHERE (? = 'Y')
    						
    Note that in this SELECT statement, there is a space between the "?" parameter and "=" character.

↑ Back to the top


Status

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

↑ Back to the top


Keywords: KB311155, kbqfe, kbprb, kberrmsg, kbqfe, kbhotfixserver

↑ Back to the top

Article Info
Article ID : 311155
Revision : 5
Created on : 9/26/2005
Published on : 9/26/2005
Exists online : False
Views : 389