Page 1 of 1

Connection To MS Excel 2007

Posted: Sun Sep 09, 2007 12:17 pm
by Hamdy
Dear All

Can i connect to Microsoft Excel and if that , which provider can i use.

Connection To MS Excel 2007

Posted: Sun Sep 09, 2007 1:45 pm
by Brendan
You should be able to use the OLEDB Data Provider.

For appropriate connection strings you can use www.connectionstrings.com

Excel 2007

Code: Select all

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=c:\myFolder\myExcel2007file.xlsx;Extended Properties="Excel 12.0;HDR=YES";

Excel

Code: Select all

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\MyExcel.xls;Extended Properties="Excel 8.0;HDR=Yes;IMEX=1";

You can then add a datasourcre from an OleDb Connection using a select statement like the following:

Code: Select all

SELECT * FROM [sheet1$]