Connecting to Excel via ADO.net - ISAM driver error

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When connecting to an .xls file in Visual C#, I get the
error 'Could not find installable ISAM driver.' I have
implemented solutions in KB article 283881, but still get
the message. I have reinstalled Office XP, Jet 4.0 SP8,
no luck.


string strConnect =
@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=D:\300Input.xls;Extended Properties=Excel
10.0;HDR=Yes";


OleDbConnection oConn = new OleDbConnection(strConnect);
try
{
oConn.Open(); //ISAM error here
}
catch (Exception Ex)
{
MessageBox.Show(Ex.Message);
}

Help Please!

Tx,
Matt
 
Hi,

Try putting Extended properties + HDR block in single parenthesis:
Extended Properties='Excel 10.0;HDR=YES;'.
Also, try setting excel provider to 8.0.
 
-----Original Message-----
Hi,

Try putting Extended properties + HDR block in single parenthesis:
Extended Properties='Excel 10.0;HDR=YES;'.
Also, try setting excel provider to 8.0.

--
Miha Markic - RightHand .NET consulting & development
miha at rthand com
www.rhand.com




.
 
¤
¤ When connecting to an .xls file in Visual C#, I get the
¤ error 'Could not find installable ISAM driver.' I have
¤ implemented solutions in KB article 283881, but still get
¤ the message. I have reinstalled Office XP, Jet 4.0 SP8,
¤ no luck.
¤
¤
¤ string strConnect =
¤ @"Provider=Microsoft.Jet.OLEDB.4.0;Data
¤ Source=D:\300Input.xls;Extended Properties=Excel
¤ 10.0;HDR=Yes";
¤
¤
¤ OleDbConnection oConn = new OleDbConnection(strConnect);
¤ try
¤ {
¤ oConn.Open(); //ISAM error here
¤ }
¤ catch (Exception Ex)
¤ {
¤ MessageBox.Show(Ex.Message);
¤ }

See connection string example below:

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


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