Microsoft KB Archive/149644

{|
 * width="100%"|

BUG: Out of Range Error When Binding a SQL_C_BINARY Datatype

 * }

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 : kbBug

Issue type : kbbug

Technology : kbSQLServSearch kbAudDeveloper kbSQLServ600 kbODBCSearch