Visual Studio 2022 unable to connect to excel

Sebring 41 Reputation points
2024-07-13T03:00:10.69+00:00

Hi Folks,

I wish to connect to Excel sheet from my Visual studio 2022 however when I create a connection and ran it the following error was produced. I am running Win10 64bit.

ERROR

Exception from HRESULT: 0xC020801C

Error at Package [Connection manager "Excel Connection Manager"]: The requested OLE DB provider Microsoft.Jet.OLEDB.4.0 is not registered. If the 64-bit driver is not installed, run the package in 32-bit mode. Error code: 0x00000000.

An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered".

Error at Data Flow Task [Excel Source [55]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0209303. There may be error messages posted before this with more information on why the AcquireConnection method call failed.

My Attempt

  1. As such I saved my excel sheet to 97-2003 worksheet (filename.xls) with my existing Microsoft Access database engine 2010 (64bit) already installed and same error.
  2. So I installed Microsoft Access database engine 2016 (32bit) in my download directory by "run accessdatabaseengine.exe /quiet" at command line. It installed Ok however when I ran preview to check it produced same error.

Qs

  1. Do I have to uninstall Microsoft Access database engine 2010 (64bit)?
  2. Is there a 32bit/64bit setting in Visual Studio to switch?
  3. Any other work around?

Much appreciate your prompt response:)

Thank you

J

Access
Access
A family of Microsoft relational database management systems designed for ease of use.
400 questions
SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,590 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 37,441 Reputation points
    2024-07-15T01:59:28.3933333+00:00

    Hi @Sebring

    You may have a try to install both 32bit and 64bit driver.

    See:

    https://datasavvy.me/2017/07/20/installing-the-microsoft-ace-oledb-12-0-provider-for-both-64-bit-and-32-bit-processing/

    Microsoft Access Database Engine 2016 Redistributable download.

    If this does not work, set the Run64bitRuntime to false or true and then have a try.

    User's image Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.

    0 comments No comments

  2. Sebring 41 Reputation points
    2024-07-15T06:52:20.75+00:00

    Hi Zoe,

    Many Thanks for your assistance.

    As per your instructions...

    1. I installed Microsoft Access database 2016 (64bit) using /quiet. So I have installed 3 versions ie
      1. Access database engine 2010 (64bit) original
      2. Access database engine 2016 (32 bit) installed yesterday
      3. Access database engine 2016 (64bit) installed today
    2. Rename mso.dll registry value to mso.dll.old
    3. Configuration Properties -> Debugging -> Change Run64BitRuntime value from True to False:

    However when I config my Connection Manager to connect to my excel sheet and data access mode=SQL command and hit preview I get the same error as below...

    TITLE: Microsoft Visual Studio


    Exception from HRESULT: 0xC020801C

    Error at Package [Connection manager "Excel Connection Manager"]: The requested OLE DB provider Microsoft.Jet.OLEDB.4.0 is not registered. If the 64-bit driver is not installed, run the package in 32-bit mode. Error code: 0x00000000.

    An OLE DB record is available. Source: "Microsoft OLE DB Service Components" Hresult: 0x80040154 Description: "Class not registered".

    Error at Data Flow Task [Excel Source [2]]: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER. The AcquireConnection method call to the connection manager "Excel Connection Manager" failed with error code 0xC0209303. There may be error messages posted before this with more information on why the AcquireConnection method call failed.


    BUTTONS:

    OK



Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.