I am writing function to call stored procedure in Oracle. When trying to call SQLConnectA, it fails, and SQLGetDiagRec returns some weird numbers, which looks like memory address instead of diagnostic message. Code which produced this error is
ret = SQLConnectA(hORAdbc, (SQLCHAR*)DCDSN.c_str(), DCDSN.length(), (SQLCHAR*)DCUSR.c_str(), DCUSR.length(), (SQLCHAR*)DCPWD.c_str(), DCPWD.length());
if (ret != SQL_SUCCESS) {
rc = SQLGetDiagRec(SQL_HANDLE_DBC, hORAdbc, 1, SqlState, &NativeError, Msg, sizeof(Msg), &MsgLen);
appfile << "MAIN:SQLConnectA hORAdbc> SQLSTATE: " << SqlState << " NativeError: " << NativeError << " Msg: " << Msg << endl;
return 0;
}
note: appfile is ofstream object (text file used for logging)
Where is the cause of this behaviour ?