Can't connect to local Oracle 11g express

I have an Oracle 11g Express installation on my personal Windows 7 PC.
Its DB name is the default - XE. I can connect to it in sqlplus just fine.
I have a .htm file on the same machine which contains a Javascript function, which I am executing in IE version 11.
(You may wonder why I am using this stack of outdated technology, but I have my reasons).

I have successfully set up an ODBC connection based on "Oracle in XE" Driver - this tests ok.

My Javascript commands are like this:

var conn=new ActiveXObject("ADODB.Connection"); conn.ConnectionTimeout=10; conn.CommandTimeout=0;

var cs="Driver=(Oracle in XEClient);dbq=localhost:1521/XE;Database=XE;Uid=myuser;Pwd=mypassword;" ;

try{; }catch(err){ alert("Could not connect: "+err.description); return false; };

  • this fails with error "[Microsoft][ODBC Driver Manager]Data source name not found and no default driver specified"

I have tried various other connection strings, with no success, but it seems like the one above SHOULD work - any advice would be greatly appreciated!

1 answer

If anyone cares, I eventually solved this:
I needed to create a System DSN using the 'Microsoft ODBC for Oracle' Driver using odbcad32.exe in Windows\SysWOW64, ie the 32-bit version of the Client.

Then the following connection string worked:
Provider=msdaora;Data Source=localhost:1521/XE;User Id=myuser;Password=mypassword;

-- just in case anyone else is trying the same thing....