By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,679 Members | 2,331 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,679 IT Pros & Developers. It's quick & easy.

Problem opening OleDB Excel connection

P: n/a
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
Nov 15 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
/// <para>OleDb:Provider=Microsoft.Jet.OLEDB.4.0;Exten ded
Properties=""Excel 8.0;"";Data
Source="+s_DocumentFolder+s_DataSetNamespace+".xls ;"</para>

Maybe a blank is missing in "ExtendedProperties" , otherwise it looks good.

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

Nov 15 '05 #2

P: n/a
"Mark Johnson" <mj*****@mj10777.de> wrote in news:40136a42$0$17570$9b4e6d93
@newsread4.arcor-online.net:
OleDb:Provider=Microsoft.Jet.OLEDB.4.0;Extended
Properties=""Excel 8.0;"";Data
Source="


Sorry - that didnt help

aacool
Nov 15 '05 #3

P: n/a
Sorry the "OleDb:" part was part of documentation - it does not belong to
the string!
"aacool" <a@b.c> schrieb im Newsbeitrag
news:Xn***********************@24.94.170.87...
"Mark Johnson" <mj*****@mj10777.de> wrote in news:40136a42$0$17570$9b4e6d93 @newsread4.arcor-online.net:
OleDb:Provider=Microsoft.Jet.OLEDB.4.0;Extended
Properties=""Excel 8.0;"";Data
Source="


Sorry - that didnt help

aacool

Nov 15 '05 #4

P: n/a
"Mark Johnson" <mj*****@mj10777.de> wrote in
news:40***********************@newsread2.arcor-online.net:
Sorry the "OleDb:" part was part of documentation - it does not belong
to the string!
"aacool" <a@b.c> schrieb im Newsbeitrag
news:Xn***********************@24.94.170.87...
"Mark Johnson" <mj*****@mj10777.de> wrote in

news:40136a42$0$17570$9b4e6d93
@newsread4.arcor-online.net:
> OleDb:Provider=Microsoft.Jet.OLEDB.4.0;Extended
> Properties=""Excel 8.0;"";Data
> Source="


Sorry - that didnt help

aacool



I figured that - it did not work even with the space between Extended
and Properties, and without the OleDb

Thanks
aacool
Nov 15 '05 #5

P: n/a
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

Nov 15 '05 #6

P: n/a
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


Nov 15 '05 #7

P: n/a
"Mark Johnson" <mj*****@mj10777.de> wrote in
news:40***********************@newsread2.arcor-online.net:
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


Thank you - the code worked as advised with the space

The working code is similar to the one you posted, apart from some other
stuff I need to do after opening the file, of course

aacool

Nov 15 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.