Pages

Monday, October 27, 2008

Display message class in Outlook / IPM.Note.voice.unity

In Outlook 2007, highlight your inbox (or any folder),
Choose View | Current View | Customize Current View,
Click Fields,
Choose All Mail Fields from the drop down,
Move Message Class to the right,
Change your Number of Lines to an appropriate value, or move up the Message Class.

Enjoy viewing your message classes!

Saturday, October 25, 2008

C# Excel OLEDB and Could not find installable ISAM

So you have chosen to manipulate Excel spreadsheets with C#, and rather than using Excel Automation you are using OLEDB. Now you find you receive "Could not find installable ISAM" when bebugging.

I will bet it has to do with escaping the quotes surrounding the "Extended Properties" in your connection string. Personally, things worked fine for me util I added the HDR or IMEX variables.

The Excel references at www.connectionstrings.com are very helpful and indicate the quotes are an issue, but don't provide specific working examples.

Here you are:

String sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\Test.xls;Extended Properties=\"Excel 8.0;HDR=No;IMEX=1;\"";

or maybe more helpfully:

String sFile = "C:\\Test.xls";

String sConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + sFile + ";Extended Properties=\"Excel 8.0;HDR=No;IMEX=1;\"";


Notice the \" escapes surrounding Excel 8.0;HDR=No;IMEX=1;

Hope that helps.