SQLDriverConnect works fine while SQLDriverConnectW gives mysterious error message

Connectivity
N/A

SQLDriverConnect works fine while SQLDriverConnectW gives mysterious error message

Hi,

We're building data analytics software on Linux and trying to bring in support for Teradata. We've followed everything in the ODBC Driver for Teradata User Guide(Release 15.10). Indeed we could connect to our testing teradata database through the provided tool tdxodbc64, which seems to be using SQLConnect, or through ql, or through our small testing snippet which is using SQLDriverConnect. However when using another snippet which calls SQLDriverConnectW instead but with exactly the same connect string, it failed!

We're using unixODBC 2.3.4. The connect string is like this "DRIVER={Teradata};DBCName=hostname;DATETIMEFORMAT=AAA;CHARSET=UTF16;QuietMode=Y;USENATIVELOBSUPPORT=YES;UID=username;PWD=password;MaxRespSize=1048576". Our small testing snippet using SQLDriverConnectW gives this mysterious error, "450:1:0:523 448", from function SQLGetDiagRec. And our application, when trying to connect to the same database, got also mysterious but different error message like this "unixODBC]呛牥摡瑡嵡佛䉄⁃敔慲慤慴䐠楲敶嵲丠䉄乃浡⁥湥牴敩⁳敷敲映畯摮椠卄⽎潣湮捥楴湯猭牴湩⹧ \xFFFF;\".

We guess it might be a encoding or unicode issue but really have no idea what exactly the problem is. Any help would be appreciated.

Thanks,

Johnny