Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Microsoft ACE OLEDB provider throws could not find installable ISAM exception

I'm trying to read Excel spreadsheets with a 64bit Process. Therefore I use the 64 bit Version of Micorosft Access Database Engine 2010.

The following code

var cs = @"Provider=Microsoft.ACE.OLEDB.12.0;"
         + @"Data Source=C:\test.xls;"
         + @"Extended Properties=""Excel 14.0;""");

con = new OleDbConnection(cs);
con.Open();

throw an Exception:

Could not find installable ISAM

Using google I found a lot of questions about this exception. But they refer to JET and seem not apply to my problem.

Any recommendations?

like image 341
Michael Stoll Avatar asked Aug 20 '10 13:08

Michael Stoll


1 Answers

The link to "This Article" is correct, However change Single quotes to Double Quotes. I'm using a OpenFileDialog to get any excel file. (I'm using Excel 2013 for testing)

=> Original Format in the post <=
//Newer version, any xls file "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=’C:\AlmostAnyExcelVersionFileRunningUnder64BitOS.xls’;Extended Properties=’Excel 12.0;HDR=NO;IMEX=1;’;"

=> Corrected Format <=
XLConnection = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Chr(34) & ExceilFileDialog.FileName & Chr(34) & ";Extended Properties=" & Chr(34) & "Excel 12.0;HDR=NO;IMEX=1;" & Chr(34) & ";"

like image 193
Christopher R. Rodgers Avatar answered Oct 14 '22 04:10

Christopher R. Rodgers