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.

PRB: ODBC 3.0 Requirements for Numeric Fields


View products that this article applies to.

This article was previously published under Q195470

↑ Back to the top


Symptoms

An ODBC Driver, which is written to conform to the ODBC 3.0 Specification, must support the SQL_C_NUMERIC datatype. If the driver returns 3.0 on a call to the SQLGetInfo function (using SQL_DRIVER_ODBC_VER), but does not support the SQL_C_NUMERIC datatype, then a SQL_ERROR may be returned while performing a SQLBindCol or SQLGetData on a decimal field when using the Microsoft Data Access Components (MDAC) 3.0 OLE DB Provider for ODBC.

NOTE: The error message that occurs is driver specific, and some drivers may not return an error message at all.

↑ Back to the top


Cause

According to ODBC 3.0 specifications, the SQL C data type, SQL_C_NUMERIC, must be a supported data conversion type for an ODBC 3.0 driver.

The OLE DB Provider for ODBC tests a driver to see if it claims to be compliant with the ODBC 3.0 Specification. If the driver claims to be an ODBC 3.0 driver, and if it supports SQL_API_SQLSETDESCFIELD, then it assumes support for SQL_C_NUMERIC. Hence, when data is prepared for retrieval from a numeric field using SQLBindCol, or retrieved directly using SQLGetData, the Provider uses SQL_C_NUMERIC instead of the default conversion SQL_C_CHAR SQL C datatype. If the ODBC 3.0 driver does not support this data type then a SQL_ERROR may occur, although this depends upon the implementation of the ODBC Driver.

↑ Back to the top


Resolution

The only workaround is that the ODBC 3.0 driver in question needs to support the SQL_C_NUMERIC SQL C datatype. Contact the vendor for your ODBC Driver to inquire about obtaining an ODBC Driver that is compliant with the ODBC 3.0 Specification.

↑ Back to the top


References

Microsoft ODBC 3.0 Software Development Kit and Programmer's Reference, Microsoft Press, ISBN 1-57231-516-4

↑ Back to the top


Keywords: KB195470, kbprovider, kbprb, kbnofix, kbdatabase

↑ Back to the top

Article Info
Article ID : 195470
Revision : 4
Created on : 3/2/2005
Published on : 3/2/2005
Exists online : False
Views : 441