Friday, 8 November 2013

Confusing “Could not find installable ISAM”

While working with Excel to programmatically read excel data using a OLEDB connection I got the error “Could not find installable ISAM”. Actually I was modifying a piece of existing code and also did change to the connection string. The change was a simple one. Actually the excel I needed to read does not had a header but the data table I got was considering the first raw as header. To fix that I was needed to add one property “HDR=No”. The connection string that is already there looks as below :

string connectionString = "Provider = Microsoft.ACE.OLEDB.12.0; Data Source = " + excelName + ";" + "Extended Properties = Excel 12.0;";

I added the property in the connection string and run the app. But I got the error “Could not find installable ISAM”. I was surprised that the error message is confusing. First, If any component of the driver is missing then how come the code was working. Secondly if there is an issue in the connections string it would have displayed a message related to connection string. After a little googling about this message and related articles I was sure that the issue is with connection string but the message is different. Finallly I got my connection string working and below is the working connection string.

string connectionString = "Provider = Microsoft.ACE.OLEDB.12.0; Data Source = " + excelName + ";" + "Extended Properties =\"Excel 8.0; HDR=No; IMEX=1\"";

No comments:

Post a Comment