Connecting to Excel via ADO.net: ISAM driver error

M

Markus Heid

Hi,
I've got following problem:
I'm trying to open a excel sheet via a ado.net oledb connection. but as soon
as the function Open is called I'm getting an exception with following text:
"Could not find installable ISAM driver". Looking in the msdn I found
several issues to that problem. I checked the registry as described and
re-registered the dll but that was effectless.
Here's my code:
string sConnString =
"Provider=Microsoft.Jet.OLEDB.4.0;DataSource=J:\\MyDir\\MyExcelFile.xls" +
/*+ ofdExcelSheet.FileName + */

";Extended Properties=\"Excel 8.0;HDR=Yes\"";

System.Diagnostics.Trace.WriteLine( sConnString );

System.Data.OleDb.OleDbConnection cn = new
System.Data.OleDb.OleDbConnection( sConnString );

cn.Open();



I'm using VS.NET 2003 and Office 2003

Does anyone have any expierences with that issue



Thanks in Advance

Markus
 
P

Paul Clement

¤ Hi,
¤ I've got following problem:
¤ I'm trying to open a excel sheet via a ado.net oledb connection. but as soon
¤ as the function Open is called I'm getting an exception with following text:
¤ "Could not find installable ISAM driver". Looking in the msdn I found
¤ several issues to that problem. I checked the registry as described and
¤ re-registered the dll but that was effectless.
¤ Here's my code:
¤ string sConnString =
¤ "Provider=Microsoft.Jet.OLEDB.4.0;DataSource=J:\\MyDir\\MyExcelFile.xls" +
¤ /*+ ofdExcelSheet.FileName + */
¤
¤ ";Extended Properties=\"Excel 8.0;HDR=Yes\"";
¤
¤ System.Diagnostics.Trace.WriteLine( sConnString );
¤
¤ System.Data.OleDb.OleDbConnection cn = new
¤ System.Data.OleDb.OleDbConnection( sConnString );
¤
¤ cn.Open();
¤
¤
¤
¤ I'm using VS.NET 2003 and Office 2003
¤
¤ Does anyone have any expierences with that issue

I would say it's likely that your connection string is incorrect. Here is an example using C#:

ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" +
"Data Source=e:\\My Documents\\Book2.xls;" +
"Extended Properties=" + (char)34 + "Excel 8.0;HDR=Yes;" + (char)34;


Paul ~~~ (e-mail address removed)
Microsoft MVP (Visual Basic)
 
M

Markus Heid

You're right "Data Source" instead of "DataSource". And that was what I'm
searching for hours.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top