none
error: Could not find installable ISAM file RRS feed

  • Question

  • Hi,

    First of all I would like to say that I am new to c# programming. I'm trying to write information into an excel file using OLEDB.

    I am getting the error "could not find installable ISAM file". After some research I'm guessing that it is my connection string that is wrong.

    Code snippet:


                System.Data.OleDb.OleDbConnection MyConnection;
                System.Data.OleDb.OleDbCommand myCommand = new System.Data.OleDb.OleDbCommand();
                string sql = null;
                MyConnection = new System.Data.OleDb.OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;Data Source='C:\test_schrijf.xlsx';Extended Properties=Excel 12.0 Xml;HDR=YES;");

     

    I'm hoping someone can tell me what's wrong

    My computer is using office 2007 and running on windows 7 x64

     

    Thanks for your time,

     

    Regards Ben


    • Edited by getske007 Tuesday, April 19, 2011 5:03 PM extra info
    Tuesday, April 19, 2011 5:00 PM

Answers

All replies

  • Hello Ben,

     

    Welcome to the MSDN Forum!

    If you installed the 64-bit version AccessDatabaseEngine_X64.exe then the Platform should be set to Any CPU. Please feel free to contact me if you have any questions.

    Thanks!

     

    Have a nice day,


    Jackie Sun [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Proposed as answer by ThorstenS Wednesday, March 7, 2012 6:04 PM
    Wednesday, April 20, 2011 6:18 AM
    Moderator
  • The Extended Properties values of connection string should be surrounded by additional double quotes. You connection string should look like

    Provider=Microsoft.ACE.OLEDB.12.0;Data Source='C:\test_schrijf.xlsx';Extended Properties="Excel 12.0 Xml;HDR=YES;"

     


    Val Mazur (MVP)

    http://www.xporttools.net


    Wednesday, April 20, 2011 9:43 AM
    Moderator
  • There are usually two issues that can cause this error. First, if the driver/provider is not installed for the platform this error can occur. As Jackie mentioned, you would need to have either the 32-bit or 64-bit version of ACE installed - depending upon your platform.

    http://www.microsoft.com/downloads/en/details.aspx?FamilyID=c06b8369-60dd-4b64-a44b-84b371ede16d&displaylang=en

    It's also possible (and more likely) that your connection string syntax is invalid as Val mentioned. See the below link for examples:

    http://www.connectionstrings.com/excel-2007

    Below is an example I have that works:

          ConnectionString = "Provider=Microsoft.ACE.OLEDB.12.0;" +
            "Data Source=C:\\Users\\...\\Documents\\My Database\\Excel\\BookTest.xlsx;" +
            "Extended Properties=" + (char)34 + "Excel 12.0 Xml;HDR=YES;" + (char)34;
    
    

    Paul ~~~~ Microsoft MVP (Visual Basic)
    Wednesday, April 20, 2011 3:34 PM