locked
The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine. RRS feed

  • Question

  • Hi

    I have tried below CS for Excel 2016 .xlsx :

    "Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}; Extended Properties='Excel 12.0;'"
    "Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}; Extended Properties='Excel 12.0 Xml; HDR=YES'"
    "Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}; Extended Properties='Excel 12.0; HDR=YES'"

    at the time of opening the excel connection i am getting the error  as "The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine"

    i want to use it for ANY CPU only.

    Regards,

    BSM

    Monday, October 24, 2016 9:22 AM

Answers

  • Hi Balaji S M,

    Thank you for posting here.

    For your question, the error message that the provider hasn't been registered on the machine on which the application is running. The ACE provider is not installed on Windows operating systems by default. You have to install it. The ACE provider is available in two forms: Microsoft Office Access database engine 2007 and the Microsoft Access Database Engine 2010 Redistributable. The 2007 version is only available as a 32-bit component whereas the 2010 version offers both 32 and 64-bit options. You need to be careful which option you choose, because a wrong choice here is the most frequent cause for the error message.

    And you could try the following code.

    string connectionString =  string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}; Extended Properties=\"Excel 12.0 Xml;HDR=No;IMEX=1\";", "C:\\Users\\v-wezan\\Desktop\\E1.xlsx");
                OleDbConnection excelConnection = new OleDbConnection(connectionString);
                excelConnection.Open();

    For more information about the excel connection string, you could refer to the link.

    I hope this would be helpful to you.

    If you have something else, please feel free to contact us.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, October 25, 2016 7:32 AM

All replies

  • Hi Balaji S M,

    Thank you for posting here.

    For your question, the error message that the provider hasn't been registered on the machine on which the application is running. The ACE provider is not installed on Windows operating systems by default. You have to install it. The ACE provider is available in two forms: Microsoft Office Access database engine 2007 and the Microsoft Access Database Engine 2010 Redistributable. The 2007 version is only available as a 32-bit component whereas the 2010 version offers both 32 and 64-bit options. You need to be careful which option you choose, because a wrong choice here is the most frequent cause for the error message.

    And you could try the following code.

    string connectionString =  string.Format("Provider=Microsoft.ACE.OLEDB.12.0;Data Source={0}; Extended Properties=\"Excel 12.0 Xml;HDR=No;IMEX=1\";", "C:\\Users\\v-wezan\\Desktop\\E1.xlsx");
                OleDbConnection excelConnection = new OleDbConnection(connectionString);
                excelConnection.Open();

    For more information about the excel connection string, you could refer to the link.

    I hope this would be helpful to you.

    If you have something else, please feel free to contact us.

    Best Regards,

    Wendy


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, October 25, 2016 7:32 AM
  • Hi Balaji,

    If your issue is solved please Mark as answer or Vote as helpful post to the appropriate answer so that it will help members if they faces similar issue.


    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    Tuesday, November 1, 2016 11:12 AM