[unixODBC-dev] HY003 error

Nick Gorham nick at lurcher.org
Thu Oct 23 10:15:02 BST 2008


Tony Khalil wrote:

>Hi there,
>
> 
>
>I am using unixODBC with easysoft ODBC Driver for Linux. I downloaded odbcpp
>library in order to use it as an intermediate level between ODBC and MSSQL
>server. When trying to fetch data from the DB I get the following error:
>
>[state HY003][unixODBC][Driver Manager]: Invalid Application Buffer Type.
>
> This error does not occur if all the fields of the table accessed are of
>type “int”.
>
> 
>
>Do you have an idea what causes such an error and how could it be solved?
>
> 
>
I would expect its the functio that checks the buffer type that has 
signaled a invalid type

check_target_type( target_type )

That checks that the SQL Type is one of the folowing:

switch( c_type ) {
case SQL_C_CHAR:
case SQL_C_LONG:
case SQL_C_SHORT:
case SQL_C_FLOAT:
case SQL_C_NUMERIC:
case SQL_C_DEFAULT:
case SQL_C_DATE:
case SQL_C_TIME:
case SQL_C_TIMESTAMP:
case SQL_C_TYPE_DATE:
case SQL_C_TYPE_TIME:
case SQL_C_TYPE_TIMESTAMP:
case SQL_C_INTERVAL_YEAR:
case SQL_C_INTERVAL_MONTH:
case SQL_C_INTERVAL_DAY:
case SQL_C_INTERVAL_HOUR:
case SQL_C_INTERVAL_MINUTE:
case SQL_C_INTERVAL_SECOND:
case SQL_C_INTERVAL_YEAR_TO_MONTH:
case SQL_C_INTERVAL_DAY_TO_HOUR:
case SQL_C_INTERVAL_DAY_TO_MINUTE:
case SQL_C_INTERVAL_DAY_TO_SECOND:
case SQL_C_INTERVAL_HOUR_TO_MINUTE:
case SQL_C_INTERVAL_HOUR_TO_SECOND:
case SQL_C_INTERVAL_MINUTE_TO_SECOND:
case SQL_C_BINARY:
case SQL_C_BIT:
case SQL_C_SBIGINT:
case SQL_C_UBIGINT:
case SQL_C_TINYINT:
case SQL_C_SLONG:
case SQL_C_SSHORT:
case SQL_C_STINYINT:
case SQL_C_ULONG:
case SQL_C_USHORT:
case SQL_C_UTINYINT:
case SQL_C_GUID:
case SQL_C_WCHAR:
case SQL_ARD_TYPE:
case SQL_C_DOUBLE:

Turn on ODBC tracing and see what is being passed into the call to 
SQLBindCol It may be a type I haven't seen.

-- 
Nick


More information about the unixODBC-dev mailing list