Microsoft KB Archive/161591

= BUG: Error 206 Calling Procedure with SQL_DEFAULT_PARAM =

Article ID: 161591

Article Last Modified on 10/16/2003

-

APPLIES TO


 * Microsoft SQL Server 6.5 Standard Edition
 * Microsoft Open Database Connectivity 2.5

-



This article was previously published under Q161591



BUG #: 16386



SYMPTOMS
If an application specifies SQL_DEFAULT_PARAM for pcbValue when doing a SQLBindParameter on a parameter in a SQL Server stored procedure, and the parameter has a default of NULL, the following SQLExecute or SQLExecDirect will fail with SQL_ERROR, and a call to SQLError will return the following error:

szSqlState = "22005", *pfNativeError = 206,

szErrorMsg="[Microsoft][ODBC SQL Server Driver][SQL Server]

Operand type clash: NNN is incompatible with void type"

where NNN is the datatype of the parameter (for example, int or char).



WORKAROUND
To work around this problem, specify SQL_NULL_DATA instead of SQL_DEFAULT_PARAM for pcbValue.



STATUS
Microsoft has confirmed this to be a problem in Microsoft SQL Server version 6.5 and Open Database Connectivity version 2.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.

Keywords: kbbug kbinterop kbusage KB161591

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.