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

  • Thread starter Thread starter Horst Walter
  • Start date Start date
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
 
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.
 
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)
 
Back
Top