Hi,
can you please try to add the following OdbcSetEnvAttr statement between the 2 OdbcAllocs in your script:
OdbcAlloc(SQL_HANDLE_ENV, ghEnvHandle);
OdbcSetEnvAttr(ghEnvHandle, SQL_ATTR_ODBC_VERSION, SQL_OV_ODBC3);
OdbcAlloc(SQL_HANDLE_DBC, ghDBCHandle, ghEnvHandle);
Cheers,
Thomas