PRB: MDAC 2.0 ODBC Requirements for Numeric Fields

ID: Q195470

The information in this article applies to:


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) 2.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.


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.


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.


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

Additional query words: Sybase

Keywords          : kbDatabase kbMDAC kbODBC kbOLEDB kbProvider 
Version           : WINDOWS:2.0
Platform          : WINDOWS 
Issue type        : kbprb 

Last Reviewed: May 13, 1999