How to use Excel as datasource and execute SQL Query?

studio

#1

Hi Team,

I am trying to connect Excel as datasource, but not able to connect. I did some research and found following post.


But still it is not helpful getting same error as mentioned.
I have attached the excel file. I am looking for correct connection string for xlsx or xls and SQL query.
Source.xlsx (8.6 KB)
Kindly assist.


#2

I did changes in Connection string as per below and it worked.

Connection String : =

Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:\Source.xlsx;Extended Properties=Excel 12.0 Xml"

SQL Query : - “select * from [Sheet1$]”