BUG: Out of Range Error When Binding a SQL_C_BINARY Datatype

ID: Q149644

2.50.0121 2.50.0126 WINDOWS kbprg kberrmsg kbinterop kbbug6.00 kbbug2.50

The information in this article applies to:

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

Keywords          : ODBC SSrvProg 
Version           : 2.50.0121 2.50.0126
Platform          : WINDOWS

Last Reviewed: September 10, 1996