With 64-bit office 2013, "Microsoft.ACE.OLEDB.12.0" cannot be loaded on 64-bit SQL server - ms-office

I am using MS office 2013 64-bit (after uninstalling 32-bit office 2013) on a 64-bit computer (with windows 10), and SQL Server 2014 Express connected through IP address.
My goal is to let SQL Server read excel data, using "SELECT * FROM OPENROWSET()" statement.
My problems is: I installed "AccessDatabaseEngine_x64.exe", but when executing "openrowset()", SQL Server gives me error msg "The 32-bit OLE DB provider "Microsoft.ACE.OLEDB.12.0" cannot be loaded in-process on a 64-bit SQL Server." Please read the following so you'll know I did tons of research and trials.
The question is: should I use AccessDatabaseEngine or AccessDatabaseEngine_x64 in this case? And how?
Background - to make this question complicated:
When I had 32-bit office on my computer, and was using "import" function under "database" on SQL Server to import excel (.xlsx) data, SQL Server forced me to install AccessDatabaseEngine (the 32-bit). So I did. And the import became successful.
But I'd like to make SQL Server to read local excel files dynamically without importing, so I decided to set up excel as server using "New Linked Server" function in SQL Server, but failed. The error msg is basically "Cannot initialized the data source object of OLE DB Provider 'SQLNCLI11' for linked server "Mycomputer". Then I found "openrowset / opendatasource" statement, tried it on SQL Server, and got error msg: "The 32-bit OLE DB provider "Microsoft.ACE.OLEDB.12.0" cannot be loaded in-process on a 64-bit SQL Server." The solutions I tried were the following:
1) uninstalled AccessDatabaseEngine;
2) instialled AccessDatabaseEngine_x64 (checked registry key to make sure its registered);
3) ran configurations as per "https://blogs.msdn.microsoft.com/farukcelik/2010/06/04/accessing-excel-files-on-a-x64-machine/";
4) ran "openrowset / opendatasource" again but still got msg "Microsoft.ACE.OLEDB.12.0" cannot be loaded in-process on a 64-bit SQL Server." Only now, I couldn't import excel (.xlsx) into SQL Server any longer, I guess because AccessDatabaseEngine was uninstalled;
5) uninstalled 32-bit office;
6) installed 64-bit office;
7 ) ran "openrowset / opendatasource" again, still got msg "Microsoft.ACE.OLEDB.12.0" cannot be loaded in-process on a 64-bit SQL Server."
8) uninstalled AccessDatabaseEngine_x64;
9) installed AccessDatabaseEngine, ran "openrowset / opendatasource" again, still got msg "Microsoft.ACE.OLEDB.12.0" cannot be loaded in-process on a 64-bit SQL Server."
The "Openrowset" statement I tries was like:
SELECT *
FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0',
'Excel 12.0 Xml;
Database=C:\documents\2016.xlsx',
[sheet1$]);
So it seems neither AccessDatabaseEngine nor AccessDatabaseEngine_x64 works for me for either 32-bit office or 64-bit office.
Did I miss something?
Thank you!

Related

OraOLEDBpus.dll: The specified module could not be found

I am facing an issue with an excel macro which connects to an Oracle database. The macro works fine on many users PC's, but on one DAAS machine, it's giving me an error when attempting to open the connection:
OraOLEDBpus.dll: The specified module could not be found
And this error as well:
An error was encountered when logging into the database
Description: Provider cannot be found. It may not be properly installed.
This is the connection string, which I don't think is an issue because it works on 20+ other users PC's.
Conn1.Open ( _
"User ID=" & strUName & _
";Password=" & PWD & _
";Data Source=" & DSN & _
";Provider=OraOLEDB.Oracle" & _
";PwdChgDlg = 0")
The OS is Win 10 64 bit and Office version is 2016 32 bit. Oracle Client 12c 32-bit has been installed on this machine.
Any thoughts on why I may be getting this error?
There are different points you have to check.
The Oracle Provider for OLE DB needs to be installed. It is not part of the bare Oracle Instant Client.
An Oracle client must be installed. The Oracle Provider for OLE DB does not work stand-alone
It must be the same architecture (i.e. 32-bit vs. 64-bit) as your MS Office
It must be the same architecture as the Oracle client
The version of the Oracle Provider for OLE DB must be exactly the same version as the Oracle client
See 32-bit Oracle Data Access Components (ODAC) and/or 64-bit Oracle Data Access Components (ODAC)
Perhaps the Oracle Provider for OLE DB exist but is not properly registered, see How do I register a DLL file on Windows 7 64-bit?
Install the 32 bit AccessDatabaseEngine.exe on this site.
Later, open cmd on this path with admin access.
Execute this command;
AccessDatabaseEngine.exe /passive

Excel Connect to Oracle 12c Using VBA

Trying connect to an Oracle Database 12c Enterprise Edition 64-bit with Excel VBA.
The client machine has the following 32-bit drivers installed:
Microsoft ODBC for Oracle
Oracle in OraClient11g_home1
Oracle in OraClient12Home1_32bit
And the following 64-bit drivers installed:
Oracle in OraClient11g_home1
Oracle in OraClient12Home1
The file has the following reference:
Microsoft ActiveX Data Objects 6.1 Library
I've tried multiple formats of the connection string but nothing works.
'This gave the error "[Oracle][ODBC][Ora]ORA-12560: TNS:protocol adapter error"
cs = "Driver={Oracle in OraClient12Home1}; UID=myuid; PWD=mypwd; SERVER=myhostname/myservicename;"
'This gave the error "[Oracle][ODBC][Ora]ORA-12154: TNS:could not resolve the connect identifier specified"
cs = "Driver={Oracle in OraClient12Home1}; UID=myuid; PWD=mypwd; SERVER=myhostname; DBQ=myservicename;"
'This gave the error "[Oracle][ODBC][Ora]ORA-12560: TNS:protocol adapter error"
cs = "Driver={Oracle in OraClient12Home1}; CONNECTSTRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhostname)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=myservicename)));UID=myuid; PWD=mypwd;"
'This would crash Excel
cs = "Driver={Oracle in OraClient11g_home1}; CONNECTSTRING=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=myhostname)(PORT=1521))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=myservicename)));UID=myuid; PWD=mypwd;"
I've also tried variations using the following drivers in the connection string
Microsoft ODBC for Oracle
OraOLEDB.Oracle
Oracle in OraClient12Home1
Thanks for your help everyone and sorry for the delayed response (had multiple work related "fires" I was putting out).
Anyway... I found a solution that worked for me. I don't think the problem was having multiple drivers on the same machine because I'm now able to connect without changing anything except the connection string method I used.
While I'm still not sure why the "driver" method of my connection string didn't work, I was able to use a "provider" based connection string and that worked.
'Using OraOLEDB.Oracle.1.
cs = "Provider=OraOLEDB.Oracle.1;User ID=myuid;Password=mypwd;Data Source=myhostname/myservicename;"
'Using OraOLEDB.Oracle.
cs = "Provider=OraOLEDB.Oracle;User ID=myuid;Password=mypwd;Data Source=myhostname/myservicename;"
'Using OraOLEDB.Oracle as a TNS-less connection string.
cs = "Provider=OraOLEDB.Oracle;Data Source=(DESCRIPTION=(CID=GTU_APP)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=myhostname)(PORT=myport)))(CONNECT_DATA=(SERVICE_NAME=myservicename)(SERVER=DEDICATED)));User Id=myuid;Password=mypwd;"
'Using variation of the above with a port included.
cs = "Provider=OraOLEDB.Oracle.1;User ID=myuid;Password=mypwd;Data Source=myhostname:myport/myservicename;"
I think it is a bad idea to have more than one version of Oracle Client installed, i.e. one 32-bit and one 64-bit.
For OLE DB (i..e "OraOLEDB.Oracle") it is even not possible to have more than one version due to limitation of COM where it is based on (unless you would register the DLL every time before you run an application).
In general you can use either ODBC or OLE DB, both should work.
The most important point is: the architecture (i.e. 32-bit or 64-bit) of your Excel must be the same as the architecture of your Oracle driver! The architecture of your database does not matter.
ODBC and OLE DB drivers are provided by Microsoft ("Microsoft ODBC for Oracle" and "MSDAO") and by Oracle (e.g. "Oracle in OraClient12Home1" and "OraOLEDB.Oracle")
The Microsoft drivers are old and deprecated, you should prefer the drivers from Oracle. Microsoft drivers exist only for 32-bit, so if your Excel is 64-bit then you are even forced to use the Oracle drivers.
Another note, the version of Oracle drivers (ODBC and OLE DB) has to be the same as the version of your Oracle client, most likely you messed it up when you installed three different Oracle clients.
In case you need to install 32-bit and 64-bit client, follow this instruction: BadImageFormatException. This will occur when running in 64 bit mode with the 32 bit Oracle client components installed

Provider cannot be found ADODB error while connecting to Excel 2016 or CSV from Internet Explorer

Background: In our organization, there is a html tool which runs in the Browser(IE11). The tool has a couple of stages and data from each stage is stored in a SharePoint list. In the final stage, all this data needs to be reconciled from a data set which comes from banks in a spreadsheet. Here the tool uses ADODB connection to connect to the Excel file, read the data from it and match with the data on SharePoint.
Problem: Recently after a windows 10 upgrade, the tool stopped exactly on the connection line throwing an error - "Provider cannot be found. It may not be installed correctly". I also got the Microsoft access Database engine re-installed from IT but to no good(this was after reading about answers to my query online)
I am the developer of this tool and it works just fine on my laptop. Below are the specifications of the connection string and other details of software installed
Windows Version: 1511(OS Build 10586. 1176) Windows 10 64 bit
IE: 11
IE version: 11.1176.10586.0
IE Update Version: KB4040685
Office: 2016
Connecting to Excel(version) - 2007-2010 (xls, xlsx format)
Connection Object: ADODB.Connection (via ActiveXObject in JavaScript )
Connection String Parameters
•Provider - Microsoft.ACE.OLEDB.12
•Extended Properties - Excel 8.0 (Also tried Excel 12.0 xml)
•HDR - Yes
•IMEX = 1
OLEDB Drivers installed on the machine: Microsoft ACE 12.0, 16.0 and Jet 4.0
This is the exact same configuration on my laptop and the tool is easily able to connect to Excel or Access also for that purpose.
I have also tried the below, nothing was a success
1.Used Jet.4.0 in the connection string - Here I got error "External table is not in the expected format" & "Unexpected error from database"
2.Tried using ODBC drivers with error - "Data source name not found and no drivers installed"
3.Opened the tool in 32 bit environment
4.Made a HTA app and ran that in 32 bit mode
I also found that in my laptop in the Microsoft Shared folder within program files, there exist Office 14 & 15 folders, but they don't exist in the newer laptops and the same in 32 bit folder of Program files(x86). Would it be possible that having those folders is making the difference?
Please help.
I have learned that installing Microsoft Access Database Engine 2010 (or 2007) on end-user machines fixes the issue, as adodb.dll file is required to be registered on computers using that provider.

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...
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
I too had the same issue and the solution is to set the oracle drivers for the excel session to 32 Bit drivers and initiate the excel.
I use the following Bat file to open the excel and it connects to oracle without any issues:
#
Set Temp=C:\Temp
Set TMP=C:\Temp
Set Oracle_Home= #YourDriveLetterhere - >M:\ORA12C\product\12.1.0\client_1
Set Path=C:\Windows;C:\Windows\System32;M:\ORA12C\product\12.1.0\client_1\bin;M:\ORA12C\product\12.1.0\client_1\nls\mesg;M:\ORA12C\product\12.1.0\client_1\network\admin;
START "" "C:\MacroFileNameWhichConnectsToOracle.xlsm"
#
The oracle server matters not.
Try opening a dos window and type c:\ tnsping yourservername
look towards installation issues.

Connect from Excel 2007 to Oracle via ODBC (Windows7 x64)

I have a Windows 7 64 bit and Excel 2007 32 bit.
I need to connect with Oracle DB by ODBC.
How can i create the above connection?
I installed 32bit client:
instantclient-basic-nt-12.1.0.2.0 and
instantclient-odbc-nt-12.1.0.2.0,
I created necessary environment paths (PATH, ORACLE_HOME, TNS_ADMIN) and I add ORACLE_HOME to variable PATH in system path.
When I'm trying to create DSN in C:\Windows\SysWOW64\odbcad32.exe I'm getting an error nr 126: system can not find a file SQORAS32.dll in %ORACLE_HOME%...
Any ideas?
I created ODBC connection!
The problem with error nr 126 still appears when I'm trying to create connection using driver "Oracle in instalclient_12_1", but when I'm using driver "Microsoft ODBC for Oracle" it works ok.

Resources