ODBC connection problem in a C++ app

Hello,

I'm having a problem in my application when I'm tring to connect to an ODBC driver using ODBC, I've imported the 4 files below:

#include <windows.h>
#include <sql.h>
#include <sqlext.h>
#include <sqltypes.h>

First I used SQLConnect to connect to the ODBC driver which fine, however I discovered that I need to enable UNICODE in my app so I have set the UNICODE flag in the preprocessor definitions which calls SQLConnectW, my problem is that SQLConnectW fails to connect and returns -1.

I have no idea what's wrong and why SQLConnect works and SQLConnectW doesn't

Your help is highly appreciated.

CPP
Topic archived. No new replies allowed.