Import Excel 2013 to vs, Microsoft ACE.OLEDB.12.0 is not registered on the local Machine

28,401
database = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source='c:\\Users\\test.xls';Extended Properties= \"Excel 8.0;HDR=Yes;IMEX=1\";");

The above connection string works using jet although i have to leave the excel file open for the time being as i get "could not decrypt file" error otherwise. I also had to save the file as a 97-03 excel xls file.

Share:
28,401
Arantuath
Author by

Arantuath

Updated on July 06, 2022

Comments

  • Arantuath
    Arantuath almost 2 years

    Creating a form application in vs 2012. I have office 2013 installed, win 8 64 bit. I get the above error for the below piece of code.

    public void SetConnection(string text1, string text2, string text3, string text4, string text5, string text6, string text7)
        {
            connectionString1 = "Initial Catalog=test; Data Source=work\\sqlexpress";
            connectionString = "Data Source='c:\\Users\\test1.xlsx';Extended Properties=Excel 12.0 Xml;Readonly=False;";
            database = new OleDbConnection("Provider=Microsoft.ACE.OLEDB.12.0;" + connectionString);
            database.Open();
            database1 = new OleDbConnection("Provider=SQLOLEDB.1;" + connectionString1);
            database1.Open();
        }
    

    I tried using jet drivers but would not work, so i turned to ace. First i got "Cannot find installable ISAM"; so installed AccessDatabaseEngine_x64 which leads me to this error. I then changed my build to x86 and same errors. So i'm out of options. I did try previous versions of AccessDatabaseEngine from 2007 and 2010 but no luck, any suggestions.

    • MethodMan
      MethodMan about 11 years
      What about checking the previous versions of Ace OleDB 12.0 in the GAC on the Machine in question? also do you know if the Machine has an installed version of Microsoft Office or it's related .DLL's when you changed the build to x86 this should work if things are installed properly .. have you tried adding the reference to ver 12 and selecting to copy local true?
    • Arantuath
      Arantuath about 11 years
      No i have not checked the GAC, i am not familiar with it so looking into it now. Not sure what you mean by 'Installed version'of office. My control shows office 2013 pro. I will also have a look at selecting local copy to true, never done this either so i have to research it.
    • MethodMan
      MethodMan about 11 years
      What I mean is for example if you have office 2010 on your laptop or desktop, when you install it, there are certain .dlls that get installed the same would hold true for a remote server, most common dlls are GAC'd ... for example signed dll's or custom 3rd party .dll's etc...
    • Arantuath
      Arantuath about 11 years
      C:\Program files\common Files\microsoft shared\office14\aceoledb.dll exists. Nothing in program files x86.
    • MethodMan
      MethodMan about 11 years
      You need to look as well as be aware of how to use the GAC
    • Arantuath
      Arantuath about 11 years
      Would you know how to open this tool in win 8. I cannot find vs command prompt so i'm currently downloading sdk!
  • Unheilig
    Unheilig over 10 years
    Please provide some words to your answer, so that the others would understand your solution better.
  • zeal
    zeal over 5 years
    This connection string throws Could not find installable ISAM. exception!