I am using a proprietary automated testing product that uses a javascript engine to run test scripts.
I am trying to connect to Oracle DB on a server to setup test data/environment. My code uses the following connection string:
var dbDriverString = 'Driver={Microsoft ODBC for Oracle};Server=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=1.1.1.1)(PORT=1521))(CONNECT_DATA=(SID=dbname)));Uid=abc;Pwd=abc;';
var connectionString = dbDriverString;
if (Database.DoAttach(connectionString, '') == true)
Tester.Assert('Connected to database.', true);
I installed Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (x64) client on my Windows VM. I am unable to connect to the database. I keep getting the following error:
[Microsoft][ODBC Driver Manager] Driver's SQLAllocHandle failed on SQL_HANDLE_ENV failed.
I have setup all paths correctly. ORACLE_HOME is set, ORACLE_HOME/bin is also set as environment variable. I have also tried to use other drivers/connection strings.
Major issue was a mismatch between Application arch and Drivers arch. Following was done on a fresh vm from scratch:
If you end up defining a User/System DSN for Oracle_Ora11gHome1 driver (wtf Oracle), TNS Service Name is yourip:port/sid