The problem is with the "Extended Properties" not having a blank between the
two words.
Using your code (with the exception of a string fileName_Text instead of
fileName.Text),
the connection will not fail if "Extended Properties" is used in the
Connection string instead of "ExtendedProperties".
Please report your results of this.
Mark Johnson, Berlin Germany
mj*****@mj10777.de
--------------------------------
This code failed :
--------------------------------
string fileName_Text = "PRSTAT00.xls";
string ConnectString =@"Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=" + fileName_Text + ";ExtendedProperties=Excel 8.0;";
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = ConnectString;
// "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=PRSTAT00.xls;ExtendedProperties=Excel 8.0;"
try
{
conn.Open();
}
catch (OleDbException e)
{
// e.Message "Installierbares ISAM nicht gefunden." string
MessageBox.Show(e.Message);
} // catch (OleDbException e)
--------------------------------
This code is OK :
--------------------------------
string fileName_Text = "PRSTAT00.xls";
string ConnectString =@"Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=" + fileName_Text + ";Extended Properties=Excel 8.0;";
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = ConnectString;
// "Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=PRSTAT00.xls;Extended Properties=Excel 8.0;"
try
{
conn.Open();
}
catch (OleDbException e)
{
MessageBox.Show(e.Message);
} // catch (OleDbException e)
--------------------------------
"Mark Johnson" <mj*****@mj10777.de> schrieb im Newsbeitrag
news:40***********************@newsread4.arcor-online.net...
I have written a small project with your code and have recieved the same
error.
I will work on this and report when I have found out why this happens.
Mark Johnson, Berlin Germany
mj*****@mj10777.de
"aacool" <a@b.c> schrieb im Newsbeitrag
news:Xn***********************@24.94.170.88... Hi,
I've been trying to open an Excel connection through OLEDB with the code
below:
string ConnectString =@"Provider=Microsoft.Jet.OLEDB.4.0; Data
Source=" + fileName.Text + ";ExtendedProperties=Excel 8.0;";
OleDbConnection conn = new OleDbConnection();
conn.ConnectionString = ConnectString;
conn.Open();
This throws the Exception "Could not find installable ISAM"
I've verified that msexcl40.dll exists in c:\windows\system32 and have
even re-registered it. No luck - please help:)
TIA
aacool