When I call ODBC_Connect("oracle","user","pass"), where oracle is the iODBC Data Source Name, I get the following error:

odbc_connect(): SQL error: [OpenLink][ODBC][Oracle Server]Error while trying to retrieve text for error ORA-12545, SQL state S1000 in SQLConnect

http://www.orafaq.com/error/ora-12545.htm states that error ORA-12545 means:
"Connect failed because target host or object does not exist"

Unfortunately, none of the methods they suggest fix the problem.

When I test the DSN using the ODBC Manager, I can connect just fine. I can also connect fine using sqlplus user/pass@tnsname, and tnsping returns an OK status for my tnsnames.ora entry. I am using a raw IP address in my tnsnames.ora file, so it is not a DNS issue.

Could this be an environment variable issue?

Any help would be greatly appreciated.
Thanks!
Jason 🙂

    5 days later

    OK, I figured out that error. If I add the following environment variables before I call odbc_connect, it works:

    putenv("OPL_LICENSE_DIR=/Library/AppSupport/openlink/bin");
    putenv("PATH=$OPI_LICENSE_DIR:$PATH");
    putenv("LD_LIBRARY_PATH=/Library/AppSupport/openlink/lib:$LD_LIBRARY_PATH");
    putenv("ODBCINSTINI=/Library/ODBC/odbcinst.ini");
    putenv("ODBCINI=/Library/ODBC/odbc.ini");

      Write a Reply...