In December 2010, Microsoft (finally!) Published a 64-bit OLEDB driver for CSV and XLSX files.
You will need the 64-bit Microsoft Access Database Engine 2010 Redistributable . Be sure to download the 64-bit version ( AccessDatabaseEngine_X64.exe ). You will need to uninstall 32-bit Office applications (including Sharepoint Designer!) In order to install it.
If you want CSV, you will need the name of the driver Microsoft Access Text Driver (*.txt, *.csv) , but I could not find the full connection string, but using this driver from OLEDB (although if you have, leave the command and I , I will change this answer). Please note that 64-bit names are different from 32-bit versions.
To read XLSX files, use the connection string as follows:
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + FilePath + ";Extended Properties=\"Excel 12.0;HDR=Yes;IMEX=2\"";
For XLS files (pre-2007 Excel), the connection string is used as follows:
"Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + FilePath + ";Extended Properties=\"Excel 8.0;HDR=Yes;IMEX=2\"";
Many thanks to this blog post and this answer for pointing me in the right direction when I came across the same problem, and for providing the content that I adapted to write this answer.
source share