samedi 28 novembre 2020

ODBC query execution failure

ALL,

I am trying to build an application in C++ that connects to Sybase SQL Anywhere with the native Sybase ODBC driver. The application is trying to execute query with 2 parameters.

When trying to execute the query with SQLExecute() I am getting an error as in the subject.

This query does execute correctly inside the same binary when the connection is done to any other DBMS (MS SQL, Postgre, mySQL). It also works correctly if I insert the query inside the ISQL utility of SQL Anywhere (but presumably it does not use ODBC, but rather ct-lib).

Looking at some of the answers here on SO, people suggest that sme parameter value might be NULL. I checked under the MSVC debugger and the variables that contain those values are definitely not NULL (both of them).

The other suggestion was that there was a problem with the query itself (copy/paste). Since the query works with the ISQL, this is not the case either.

So, any other possibilities why the query fails?

TIA!!

Aucun commentaire:

Enregistrer un commentaire