C# Create Excel sheet -> Could not find installable ISAM

H

Horst Walter

I am using C# / ADO.NET to create an Excel sheet:

This connection string works:
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename + ";" +
"Extended Properties=Excel 8.0;";

This connection string DOES NOT:
....
"Extended Properties=Excel 8.0;HDR=YES;";
=> Error: Could not find installable ISAM
Remark: I've tried ";HDR=YES;" and ";HDR=YES"

Honestly I do not understand how this is related?
Regards HW
 
H

Hussein Abuthuraya[MSFT]

The proper connection string would be:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=<Pathofthe.xlsfile>;Extended
Properties=""Excel 8.0;HDR=Yes;IMEX=1"""

Note the 2 double quotes around the Extended Properties argument.


Thanks,
Hussein Abuthuraya
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2002 Microsoft Corporation. All rights
reserved

Are you secure? For information about the Microsoft Strategic Technology
Protection Program and to order your FREE Security Tool Kit, please visit
http://www.microsoft.com/security.
 
P

Paul Clement

On 3 Jan 2004 11:39:04 -0800, (e-mail address removed) (Horst Walter) wrote:

¤ I am using C# / ADO.NET to create an Excel sheet:
¤
¤ This connection string works:
¤ "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + filename + ";" +
¤ "Extended Properties=Excel 8.0;";
¤
¤ This connection string DOES NOT:
¤ ...
¤ "Extended Properties=Excel 8.0;HDR=YES;";
¤ => Error: Could not find installable ISAM
¤ Remark: I've tried ";HDR=YES;" and ";HDR=YES"
¤

Tricky syntax as Hussein pointed out. Here is an example that I have used:

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)
 

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