Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Connecting to 32 bit Oracle client with 64 bit Excel

I'm trying to connect my Excel to Oracle with this connection string in VBA:

dim cn As New ADODB.Connection
cn.Open "Provider=OraOLEDB.Oracle;Data Source=source;User Id=userid;Password=pwd;"

I'm getting this error:

Run-time error '3706':
Provider cannot be found. It may not be properly installed.

Relevant references:

Microsoft ActiveX Data Objects 6.1 Library
OraOLEDB 1.0 Type Library
  • Excel is MS Office Professional Plus 2010 64-bit
  • Windows is 7 Enterprise, service pack 1, 64 bit
  • Oracle client is 11.2.0 32 bit (I think)
  • Oracle server is Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production

Now... I have scoured the net and cannot figure out what the issue is, but my best guess is there's some 32 bit vs 64 bit conflict with drivers I'm using. I'm trying to get a sense of what path I should be taking before I involve my company's IT department to try installing stuff for me. Does the Oracle client have to be 64 bit if MS Office is? Or do I just need the 64 bit Oracle Data Access Components? I've tried a bunch of different connection strings with no success, including using MSDAORA instead of OraOLEDB.Oracle...

like image 417
Paul Exter Avatar asked Oct 31 '22 09:10

Paul Exter


1 Answers

Yes, when you use 64-bit Excel you must install also 64-bit Oracle Client and 64-bit OLE DB Provider.

OLE DB Provider from Microsoft (i.e. MSDAORA) does not exist for 64-bit. It exists only for 32-bit and has been deprecated for very long time already.

I don't know whether you need your 32-bit Oracle Client for something else, so maybe you cannot simply remove it from your PC. Here is an instruction how to install both 32-bit and 64-bit Oracle Client on one machine. Install Oracle Client x86 and x64

like image 196
Wernfried Domscheit Avatar answered Nov 15 '22 07:11

Wernfried Domscheit