42

I've written some VBA code in an Excel workbook to retrieve data from an Access database in the same directory on a desktop. It works fine on my machine and several other machines running Windows XP, but when we tested this on a Vista machine, we encountered the following error:

Could not find installable ISAM

I've done a bunch of searching online but can't seem to find a concrete answer. The connection string seems to be fine, and, as I mentioned, it works on several machines.

Does anyone have any idea what could be causing this? My connection string is as follows:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\ptdb\Program Tracking Database.mdb;

Thanks

8 Answers 8

79

Place single quotes around the Extended Properties:

OleDbConnection oconn = 
    new OleDbConnection(
        @"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" + path + ";Extended Properties='Excel 8.0;HDR=YES;IMEX=1;';");

Try it, it really works.

2
  • 2
    Cool. It also works with the Microsoft.ACE.OLEDB.12.0 provider and Excel 12.0 xml Extended properties. Thanks!
    – juanreyesv
    Commented Oct 22, 2013 at 4:25
  • 2
    Thanks, that solved a weird one for me. Note that the IMEX=1 flag is what you need if you get mysterious missing data in your results.
    – Mason
    Commented Jul 10, 2014 at 18:38
21

Try putting single quotes around the data source:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source='D:\ptdb\Program Tracking Database.mdb';

The problem tends to be white space which does have meaning to the parser.

If you had other attributes (e.g., Extended Properties), their values may also have to be enclosed in single quotes:

Provider=Microsoft.Jet.OLEDB.4.0;Data Source='D:\ptdb\Program Tracking Database.mdb'; Extended Properties='Excel 8.0;HDR=YES;IMEX=1;';

You could equally well use double quotes; however, you'll probably have to escape them, and I find that more of a Pain In The Algorithm than using singles.

7
  • instead of single quotes, used \"...\" to encase datasource path and that worked for me
    – Dave
    Commented Apr 26, 2012 at 1:12
  • 1
    @Ortund: it didn't solve your particular problem, and that's worth a down vote?!? Jeese-Louise.
    – BIBD
    Commented Sep 20, 2012 at 14:27
  • @Dave The question is marked VBA, which doesn't support C-style character escaping. In VBA, you can use two double-quotes inside a string to represent one double-quote.
    – Zev Spitz
    Commented Dec 20, 2012 at 17:25
  • @Ortund Are you using VBA or C#?
    – Zev Spitz
    Commented Dec 20, 2012 at 17:26
  • I had to put single quotes round both the data source and the extended properties and then it was fixed. Thanks! Commented Jun 7, 2013 at 10:34
3

Just use Jet OLEDB: in your connection string. it solved for me.

an example is below:

"Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source=E:\Database.mdb;Jet OLEDB:Database Password=b10w"
0

I have just encountered a very similar problem.

Like you, my connection string appeared correct--and indeed, exactly the same connection string was working in other scenarios.

The problem turned out to be a lack of resources. 19 times out of 20, I would see the "Could not find installable ISAM," but once or twice (without any code changes at all), it would yield "Out of memory" instead.

Rebooting the machine "solved" the problem (for now...?). This happened using Jet version 4.0.9505.0 on Windows XP.

0

I used this to update a excel 12 xlsx file

        System.Data.OleDb.OleDbConnection MyConnection;
        System.Data.OleDb.OleDbCommand myCommand = new System.Data.OleDb.OleDbCommand();
        MyConnection = new System.Data.OleDb.OleDbConnection("provider=Microsoft.ACE.OLEDB.12.0;Data Source='D:\\Programming\\Spreadsheet-Current.xlsx';Extended Properties='Excel 12.0;HDR=YES;';");
        MyConnection.Open();
        myCommand.Connection = MyConnection;
        string sql = "Update [ArticlesV2$] set [ID]='Test' where [ActualPageId]=114";// 
        myCommand.CommandText = sql;
        myCommand.ExecuteNonQuery();
        MyConnection.Close();
-1

Use this connection string

string connectionString = @"Provider=Microsoft.ACE.OLEDB.12.0;" +
      "Data Source=" + strFileName + ";" + "Extended Properties=" + "\"" + "Excel 12.0;HDR=YES;" + "\"";
1
  • The OP is not getting data from Excel, but from MS Access, so an Excel connection string is not a good idea. In addition, the tag says VBA, so the syntax you show is not suitable.
    – Fionnuala
    Commented Oct 13, 2011 at 7:41
-2

This problem is because the machine can't find the the correct ISAM (indexed sequential driver method) registered that Access needs.

It's probably because the machine doesn't have MSACeesss installed? I would make sure you have the latest version of Jet, and if it still doesn't work, find the file Msrd3x40.dll from one of the other machines, copy it somewhere to the Vista machine and call regsvr32 on it (in Admin mode) that should sort it out for you.

1
  • 1
    OLE DB (note the space) has providers not 'drivers', and none have the name "MS Access". The ACE provider is named Microsoft.ACE.OLEDB.<version> and the deprecated Jet providers were named Microsoft.Jet.OLEDB.<version>.
    – onedaywhen
    Commented Feb 5, 2009 at 9:39
-2

Use the connection string below to read from an XLSX file:

string ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" + <> + ";Extended Properties=Excel 8.0;";

Not the answer you're looking for? Browse other questions tagged or ask your own question.