BUG: Out of Range Error When Binding a SQL_C_BINARY Datatype

Last reviewed: September 9, 1996
Article ID: Q149644
The information in this article applies to:
  • Microsoft Open Database Connectivity, version 2.50
  • Microsoft SQL Server, version 6.0

BUG#: 14757 (6.00)

SYMPTOMS

The SQL Server ODBC driver versions 2.50.0121 and v2.50.0126 returns a

'numeric value out of range' error when a SQL_C_BINARY C data type is bound
to a SQL_TINYINT or SQL_INTEGER SQL data type using the SQLBindParameter API.

CAUSE

This problem only happens when you do a SQLPrepare and SQLExecute with

'Generate Stored Procedure for Prepared Statement' option checked in the
SQL Server ODBC data source setup dialog box.

WORKAROUND

  1. Use SQL_C_TINYINT or SQL_C_INTEGER instead of SQL_C_BINARY.

  2. Use SQLExecDirect instead of SQLPrepare and SQLExecute.

  3. Clear the 'Generate Stored Procedure for Prepared Statement' option under the 'Options' button in the SQL Server ODBC data source setup dialog box. You can then use SQLPrepare and SQLExecute instead of SQLExecDirect.

STATUS

Microsoft has confirmed this to be a problem in SQL Server ODBC Driver (v2.50.0121 and v2.50.126). We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional reference words: 6.00 2.50 odbc sql6
KBCategory: kbprg kberrmsg kbinterop kbbug6.00 kbbug2.50
KBSubcategory: odbc ssrvprog




THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 9, 1996
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.