473,399 Members | 3,888 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Problem opening OleDB Excel connection

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
7 11576
/// <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
"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
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
"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
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
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
"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Tom D. | last post by:
I just got a new computer. I transfered my web site files over and setup my access database system ODBC driver. I've compared settings on both computers. But when I run my web site code on new...
0
by: ImraneA | last post by:
Hi there Have a database, where front-end interface allows user to select a ms access database. From there, standard tables are linked. Routine, that creates a spreadsheet, for each table a...
4
by: Dave | last post by:
Hey guys, I have an ODBC problem that has me stumped. I wrote a VBA script to run in Microsoft Excel that pulls data out of an application using that application's ODBC driver and puts it into...
3
by: shachar | last post by:
hi all. i wrote this code and i get an error msg: Private Pr_MyCon As new System.Data.OleDb.OleDbConnection Private Pr_DataSet As new DataSet("Temp") Private Pr_DataAdapter As...
5
by: CyberLotus | last post by:
Hi, I've created a web application and through this I want to import Excel data to database. Following is the code that I've written, ...
5
by: srinivas | last post by:
Hi, I have a ASP.net application which takes excel sheet as input.It retrieves the data from the excel sheet and using that data it generates reports. On my PC everything is working fine.But if...
1
by: explode | last post by:
I made a oledbdataadapter with this code Public Sub Novo(ByVal nova1 As String, ByVal nova2 As String) Dim i As Integer Dim nova As OleDb.OleDbDataAdapter = New OleDb.OleDbDataAdapter Dim veza...
0
by: aloneball | last post by:
I have several Excel files which I need to import into a SQL server. I open each file using string connectionString = "Provider=Microsoft.Jet.OLEDB.4.0;" + "Data Source = " + fileName +...
6
by: =?Utf-8?B?S3VuIE5pdQ==?= | last post by:
Dear all, I'm trying to use oledb to get the content of an excel file. Now I can use oledb to get the content of a datasheet. But I should know the name of the datasheet in advance. How can I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.