Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 195470 - Last Review: March 2, 2005 - Revision: 2.2
PRB: ODBC 3.0 Requirements for Numeric Fields
This article was previously published under Q195470
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.
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
APPLIES TO
- Microsoft Data Access Components 2.0
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7
- Microsoft OLE DB Provider for ODBC 2.0
| kbdatabase kbnofix kbprb kbprovider KB195470 |
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate