Reputation: 111
Need some help please. I am getting Source Connection error when I try to make it dynamic.
I am using Visual Studio 2010, Excel 2010, SQL 2012 running on WIN 2008.
I am trying to do this in VS: Connection Manager (Source) – I have SQL 2012 and Excel 2010 / 2016
Steps:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
+@[User::FileName]+";Extended Properties=\"Excel 8.0:HDR=Yes\";"
The above breaks Source Connection.. I am attaching screen shots
Please help. Thank you
Upvotes: 3
Views: 275
Reputation: 37313
First
In extended properties why using :
Replace it with
;
Second
For excel 2007 files and newer .xlsx
you have to use Microsoft.ACE.OLEDB
Provider instead of Microsoft.Jet.OLEDB
your connection string must be like the following :
Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myExcel2007file.xlsx;
Extended Properties="Excel 12.0;HDR=YES";
you expression might look like:
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source="
+@[User::FileName]+";Extended Properties=\"Excel 12.0;HDR=Yes\";"
Upvotes: 1