Cannot read Excel files in SSIS 2008 - excel

I'm stuck trying to get SSIS 2008 to read an Excel file.
Yesterday, I migrated our SSIS project from 2005 to 2008, and though the upgrade said it worked, I cannot get it to read an Excel file. I read online that I needed to upgrade the JET drivers to Office 2007 (AccessDatabaseEngine.exe), which I did. And voila! Everything started working!
Unfortunately today, I rebooted my machine, and everything is broke again. Same error as before. I've tried re-installing the JET driver, and even installed SQLExpress 2008, which I read also has the upgraded JET driver. But to no avail.
I cannot even create a brand new SSIS project/package, add an Excel Connection Manager, pointing to a simple Excel file that I made up of just a few numbers in column A, add a new Data Flow Task, and w/in it, add an Excel source using bound to the Excel Connection Manager. When I do something as simple as this, I get:
Unspecified Error (real helpful)
SSIS Error Code: DTS_E_OLEDBERROR
Error Code: 0x80004005
Source: "Microsoft JET Database Engine"
DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER
Hresult: 0xC020801C
I don't have a 64bit PC, and I did have everything working until I rebooted my PC.
I only have Office 2003, and I have the SQL2008 Dev Tools installed.
Any help or suggestions would be appreciated. Is there a way to get more detailed information of the failure?

I've had more success in reading office documents on x64 environments using the newer ACE drivers:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c06b8369-60dd-4b64-a44b-84b371ede16d&displaylang=en
Your connection string will be something like:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myfile.xls;Extended Properties="Excel 12.0 Xml;HDR=YES";
Might be worth a try!

Related

SSIS Excel Connection "No tables or views could be loaded"

I am using Visual Studio 2017 and trying to connect to an Excel file source for a data flow. I have tried all of the following solutions found on StackOverflow and none of them work:
Installed 32-bit Microsoft Access Database Engine for 2010 (I am running 32-bit version of Office)
Changed Run64BitRuntime to "False"
Delay Validation = "True" everywhere, inc the connection manager
Changing the connection string to various suggestions found here and on other sites.
Made sure the Excel file was closed.
I've connected to Excels sources successfully hundreds of times in other lives, but at this new job I've had to install VS myself and I've never had to do that before. Until now, the install has seemed fine and I can do plenty of other things without issue--I just can't connect to an Excel file source. I'm desperate. Any ideas, anyone?
Thanks to any who answer.
Error message I get:
"Could not retrieve the table information for the connection manager 'Excel Connection Manager'.
Failed to connect to the source using the connection manager 'Excel Connection Manager'"
I got it to work by uninstalling and then re-installing VS 2017. I suspect--but am not sure--that the key was to have the 32-bit Microsoft Access Database Engine for 2010 installed PRIOR to having the VS 2017 installed. That was not the case when I first installed VS 2017. But after uninstalling VS, I uninstalled then re-installed the 32-bit Access drivers, then reinstalled VS 2017 and my Excel connection worked fine. I also did all of the other steps outlined above prior to trying my connection, though I don't know if they were necessary.

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.

ODBC Excel Driver: Unexpected error from external database driver

Since the Windows update from October 10, the ODBC Excel drivers have stopped working. We get the following error when trying to read a file:
"Unexpected error from external database driver (1)"
We open Excel files in Delphi using an ADO connection with the following connection string:
Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";
I can get it to work by switching to Microsoft.ACE.OLEDB.12.0, but for that to work, all our customers would have to install the Microsoft Access Database Engine Redistributable on all the computers they use our software on.
Does anybody have another solution or workaround? Thanks in advance.
On a customers machine I have deinstalled KB4041681 (Windows 7) which came with last Microsoft Patch.
On my machine I have deinstalled KB4041676 (Windows 10).
After that Microsoft.Jet.OLEDB.4.0 is now working.
I hope that Microsoft will fix this bug soon.
There is one solution. Replace "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1"
with Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\MyExcel.xls; Extended Properties=\"Excel 12.0;HDR = YES;
After this change you will have to install 2007 Office System Driver: Data Connectivity Components from link on customer machine.
I had the same problem with 2 applications developed by me since 3 years (c# and java).
Since 10-oct-2017 I couldn't export to excel 2003 but 2007 worked, and couldn't import from excel 2003 but 2007 worked too for import.
In ArcGIS Desktop 10.5.1 By ESRI (a most popular software for Geographic processing) Couldn't open excels 2003 and .mdb files.
Temporally Solution: uninstall KB4041693, KB4041687 in windows 8.1 (maybe for w10).
In microsoft changelog of both path say something about "updates [...] and security updates for microsoft jet".
After uninstall and restart all softwares becomes to be normal again.
this problem was introduced in 10-oct-2017.
In microsoft forums this problemas was reported (kb4041693 should "fix" it but still doesn't work).
Maybe in few weeks they will path (properly) this issue.
For me, it worked following these steps:
ps.: We have a Windows Server 2008R2
1 – Download and install this: https://www.microsoft.com/en-us/download/details.aspx?id=23734
2 – Open the .dtsx file and change your Excel connection. On the properties dialog, Click on the three dots in the ConnectionString property and change it to Microsoft Excel 2007. This will automatically change your connection string to:
Provider=Microsoft.ACE.OLEDB.12.0;Data Source={YOURPATH};Extended Properties=”Excel 12.0 XML;HDR=YES”;
3 – Some of our .dtsx files point to a config file (usually has a .dtsConfig extension). I also changed these guys to point to the right provider (pretty much copied and pasted the connection string I got from visual studio)
After this, I ran the SQL Job again and it worked fine.
If you are working with SSIS package then please change your Excel Sheet version 2003 to 2007 in Excel Source or Excel destination.Generally this issue due to excel version.
I had the same problem. Changed Excel 2007 in Excel destinations. It worked. This is same as changing the provider=Microsoft.ACE.OLEDB.12.0.
HERE is the solution... i found it in another forum and work perfectly for me...
it will works 100%
As mentioned in the following:
https://forums.embarcadero.com/thread.jspa?messageID=902557&tstart=0
https://forum.kanors-emr.org/showthread.php?tid=571&pid=2652#pid2652
The KB4041681 installs version 4.0.9801.1 of msexcl40.dll.
Find prior version (4.0.9801.0) of msexcl40.dll
Place in another directory. They suggest the application directory, but since in the next step you will modify registry to point to this older version, it can probably go anywhere.
Update registry key HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Jet\4.0\Engines\Excel\win32 to point to the location from step 2.
Uninstall these updates(according to your OS) and your code will start running normally
KB4041681 - Windows 7 SP1 and Windows Server 2008 R2 SP1
KB4041690 -Windows Server 2012
KB4041693 - Windows 8.1 and Windows Server 2012 R2
KB4041678 - For me this was the issue
https://support.microsoft.com/en-in/help/4041678/windows-7-update-kb4041678
This problem was introduced by a recent update of Microsoft Office. there are not alternative solutions at the moment.

Error in OleDbConnection.Open() when trying to read Excel XLSB

I'm using Visual Studio 2013 with MVC 3 Razor. I'm able to upload and save XLSB file, and I'm trying to read data from the uploaded XLSB. I have the below connection string and method to initialize the OleDbConnection:
strConStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Projects\Excel1.xlsb;Extended Properties='Excel 8.0;HDR=True'";
OleDbConnection connExcel = new OleDbConnection(strConStr);
The error occur at connExcel.Open(). Below is the error message:
An exception of type 'System.Data.OleDb.OleDbException' occurred in System.Data.dll but was not handled in user code
Additional information: This file was created in a previous beta version of Excel 2007. Open the file with Excel 2007 to save it to the most recent version of the Excel 2007 file format before opening the file in Access 2007.
I had AccessDatabaseEngine installed in my PC. In my control panel, I have the following installed engine info:
Name: Microsoft Office Access database engine 2007 (English)
,Size: 19.2 MB
,Version: 12.0.4518.1031
I'm not sure if this is the correct version to read XLSB file. My PC is x64 bit by the way.
My colleague also have the same type of Microsoft Office Access database engine 2007 installed in his PC but his version is "12.0.66XX", the code works fine on his side.
Please let me know if I need to install another version of Access Database Engine, or any other way to resolve this error.
I'm able to resolve this after a long studies and research.
Apart of the Microsoft Office Access database engine 2007 that is already installed in my machine, I also download and install Microsoft Access Database Engine 2010 Redistributable.
After that, I need to download Microsoft Office Access Runtime and Data Connectivity 2007 Service Pack 2 (SP2) to install and then reboot my machine.
Everything work like magic afterwards.
And this is my working connection string:
strConStr = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Projects\Excel1.xlsb;Extended Properties='Excel 12.0;HDR=True'";

SSIS and 64bit excel

I have researched this thoroughly but I've yet to find a satisfactory answer.
I am using SQL Server Data Tools 2010 and Microsoft Office 2013 64-bit. I know that there is a compatibility problem and I am trying to solve it because I know for a fact that you can use an .xlsx file as a data source in a Data Flow.
First I tried setting Run64BitRuntime to False in Project -> Properties -> Configuration Properties - > Debugging but it didn't work
Whenever I try importing an .xlsx file I get the same error
Microsoft Visual Studio
------------------------------
Could not retrieve the table information for the connection manager
'Source Path'. Failed to connect to the source using the connection
manager 'Source Path'
------------------------------
So I tried downloading the "Microsoft Access database engine 2010" as so many suggested. The 64-bit installed successfully but the 32-bit returned the following error
You cannot install the 32-bit version of Microsoft Access database engine 2010
because you currently have 64-bit Office products installed.
Now I know I am missing a step here cause while I can see "Microsoft Access database engine 2010" in the list of installed programs in control panel it does not show up as an option in the Provider list when I am trying to create a new Connection Manager.
So before I result following the instruction on this blog I would like to ensure there is no easier way of solving the problem
Thank you in advance for you time.
If you're machine is x64, forget about Excel, as there is no driver available.
Just convert the file to CSV and use a Flat File Connector instead.
Ok, the answer was so ridiculously easy that I kind of feel ashamed for this post now.
If you are using Microsoft Office 2013 64-bit and want to work with SSIS you have to download and install the 32-bit Microsoft Access Database Engine 2010 Redistributable, not the 64-bit, set Run64BitRuntime to False and everything will work like a charm.

Resources