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: SQL_BIGINT in 2.x ODBC Driver is mapped to SQL_C_SBIGINT 3.0 datatype


View products that this article applies to.

Symptoms

When the Microsoft OLEDB Provider for ODBC driver (MSDASQL) is using an ODBC driver that is ODBC 2.x compliant, and the driver reports a SQL_BIGINT datatype (-5), the ODBC provider (MSDASQL) chooses a C datatype of SQL_C_SBIGINT for use in the SQLBindCol() ODBC API function. However, because SQL_C_SBIGINT is an ODBC 3.x datatype, this generates the following error from the ODBC Driver Manager:
S1003 [Microsoft][ODBC Driver Manager] Driver does not support this parameter
This problem occurs in all releases of the ODBC provider (Msdasql.dll) version 2.50.4403.6 (MDAC 2.5 RTM) and later.

↑ Back to the top


Cause

When the ODBC provider first loads and uses an ODBC driver, the driver is queried to see what version of ODBC it supports, 2.x or 3.x. This information is stored in the connection handle class.

The provider keeps internal structures to do the datatype mapping between SQL datatypes (such as SQL_CHAR) and C datatypes (such as SQL_C_CHAR). The provider is not checking the version that it stored for the ODBC driver before performing the SQL-to-C datatype mapping, and simply maps the SQL datatype of SQL_BIGINT to an ODBC 3.x datatype of SQL_C_SBIGINT. This datatype is not recognized in an ODBC 2.x driver, and causes the ODBC Driver Manager to produce an error.

↑ Back to the top


Resolution

To resolve this problem, obtain the latest service pack for Microsoft MDAC 2.5. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
293312 How to obtain the latest MDAC 2.5 service pack
To resolve this problem, obtain the latest service pack for Microsoft Data Access Components 2.6. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
300635 How to obtain the latest MDAC 2.6 service pack

Hotfix

The MDAC 2.5 and MDAC 2.6 version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
MDAC 2.5 English
   Date         Version            Size    File name
   ------------------------------------------------------
   01/31/2001   2.53.6131.0     303,376    Msdasql.dll
   01/31/2001   2.53.6131.0      16,384    Msdasqlr.dll
   01/31/2001   2.53.6131.0      78,096    Msdatl2.dll
   01/31/2001   2.53.6131.0      53,520    Msdatt.dll
   03/14/2001                   473,280    Q277033_W2K_SP3_x86_en.EXE
				
MDAC 2.5 French
   Date         Version            Size     File name
   -------------------------------------------------------
   01/31/2001   2.53.6131.0     303,376     Msdasql.dll
   02/14/2001   2.53.6131.0      16,384     Msdasqlr.dll
   01/31/2001   2.53.6131.0      78,096     Msdatl2.dll
   01/31/2001   2.53.6131.0      53,520     Msdatt.dll
   02/28/2001                   484,408     Q277033_w2k_sp3_x86_FR.EXE
				
MDAC 2.6 English
   Date         Version            Size      File name
   -------------------------------------------------------
   01/31/2001   2.61.7131.0     311,568      Msdasql.dll
   01/31/2001   2.61.7131.0      16,384      Msdasqlr.dll
   01/31/2001   2.61.7131.0      94,480      Msdatl3.dll
   01/31/2001   2.61.7131.0      24,848      Msdatt.dll
   03/05/2001                   269,312      Q277033_MDAC26_SP1_x86_en.exe
				
MDAC 2.6 French
   Date         Version            Size      File name
   --------------------------------------------------------
   01/31/2001   2.61.7131.0     311,568      Msdasql.dll
   02/14/2001   2.61.7131.0      16,384      Msdasqlr.dll
   01/31/2001   2.61.7131.0      94,480      Msdatl3.dll
   01/31/2001   2.61.7131.0      24,848      Msdatt.dll
   03/09/2001                   271,360      Q277033_MDAC26_SP1_x86_fr.exe
				

Windows 2000

To resolve this problem, obtain the latest service pack for Windows 2000. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
260910 How to obtain the latest Windows 2000 service pack
The Windows 2000 Service Pack 3 version of this hotfix has the file attributes (or later file attributes) that are listed in the following table. The dates and times for these files are listed in Coordinated Universal Time (UTC). When you view the file information, it is converted to local time. To find the difference between UTC and local time, use the Time Zone tab in the Date and Time item in Control Panel.
Date       Time       Version      Size    File name
--------------------------------------------------------
2/28/2001  12:24p    2.53.6131.0  303,376  Msdasql.dll
2/28/2001  12:24p    2.53.6131.0   16,384  Msdasqlr.dll
2/28/2001  12:24p    2.53.6131.0   78,096  Msdatl2.dll
2/28/2001  12:24p    2.53.6131.0   53,520  Msdatt.dll
				

↑ Back to the top


Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in Microsoft MDAC 2.5 Service Pack 3. This problem was first corrected in Microsoft Data Access Components 2.6 Service Pack 1.

Windows 2000

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section. This problem was first corrected in Windows 2000 Service Pack 3.

↑ Back to the top


More information

In OLE DB, SQL_BIGINT datatypes are DBTYPE_I8, which is an 8-byte signed integer. However, per the ODBC 2.x specifications, the default mapping for SQL_BIGINT in a 2.x driver is SQL_C_CHAR.

The ODBC provider (MSDASQL) has been modified so that SQL_BIGINT datatypes are now internally mapped to SQL_C_CHAR when using an ODBC 2.x driver, and then converted to DBTYPE_I8 when requested by OLE DB.

To determine if an ODBC driver is encountering this problem, examine an ODBC trace to see if a SQL_BIGINT datatype is being used. An example of the datatype attributes that will generate the error is shown below.
inetinfo        924-1bc	EXIT  SQLDescribeColW  with return code 0 (SQL_SUCCESS)
		HSTMT               01862458
		UWORD                        1 
		WCHAR *             0x00000000 
		SWORD                        0 
		SWORD *             0x00000000
		SWORD *             0x0277ECB4 (-5)
		SQLLEN *            0x0277ECC0 (19)
		SWORD *             0x0277ECD0 (0)
		SWORD *             0x0277ECAA (0)
				
This shows the SQL datatype (6th argument) being reported as SQL_BIGINT (-5) with a column size (7th argument) of 19.

The Microsoft ODBC drivers (for instance, the Microsoft SQL Server ODBC Driver) should not generate this error because they are mostly ODBC 3.x compliant. The Microsoft ODBC Driver for Oracle is ODBC 2.x compliant, but does not support the SQL_BIGINT datatype. Third-party drivers that are ODBC 2.x compliant and also support SQL_BIGINT may experience this problem.

REFERENCES

This fix also contains a resolution for the problem that is outlined in the following article in the Microsoft Knowledge Base:
274604 MSDASQL Provider improperly handles negatively scaled SQL_NUMERIC_STRUCT values

↑ Back to the top


Keywords: kbhotfixserver, kbqfe, kbmdac250sp3fix, kbbug, kbfix, kbmdac260sp1fix, kbwin2000sp3fix, KB277033

↑ Back to the top

Article Info
Article ID : 277033
Revision : 8
Created on : 9/26/2005
Published on : 9/26/2005
Exists online : False
Views : 577