BUG: Out of Range Error When Binding a SQL_C_BINARY Datatype

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 query words: odbc sql6

Keywords : ODBC SSrvProg
Version : WINDOWS:2.50; winnt:6.0
Platform : WINDOWS winnt
Issue type :


Last Reviewed: August 25, 1999
© 2000 Microsoft Corporation. All rights reserved. Terms of Use.