none
How to write a Connection String in an Office 2019 or Access Runtime environment based on C2R installation? RRS feed

  • Question

  • Well, let me describe my problem and see if there's any professional can help. Thanks a lot!

    1. Office 2016 has a version of C2R (Click to Run), but rare, and Office 2019 and 365 is completely C2R installation, I have to use the Access database in a C2R-based installation environment;

    2. Access 2019 version does not have a significant improvement over the 2016 version, the main version number is still 16.0;

    3. C2R installation, including ACEOLEDB.DLL and many other data engine files' location has been different from the Windows Installer installation folder location, and there is NO Access Connectivity Engine's general registration items in the registry  (which is the key cause of the problem);

    4. I have an application written based on .Net Framework 4.8 C# that needs to access the Access database through OLEDB in an environment with Office 2019 or Office 365 Access Runtime (regardless of the problems that can occur with 32 bits and 64 bits) ;

    5. The previous writting method of connection string in the program was "Provider=Microsoft.ACE.OLEDB.16.0; Jet OLEDB:Registry Path=Software\Microsoft\Office\16.0\Access\Access Connectivity Engine; ……".

    Here's the problem, there was an error for connecting the database, indicating "Microsoft.ACE.OLEDB.16.0 is not registered", how to solve it? Thank you!

    Monday, September 9, 2019 5:59 AM

All replies

  • This kind of problem is Version related.

    So if you have 64bit  OS and your Office is 64 bit then you need  64 bit Access driver(Provider)

     if you have 64bit  OS and your Office is 32 bit then you need  32 bit Access driver(Provider)

     if you have 32bit  OS and your Office is 32 bit then you need  32 bit Access driver(Provider)

    Check all your .NET solution if its pointing 64 bit.


    Monday, September 9, 2019 6:13 AM
  • This kind of problem is Version related.

    So if you have 64bit  OS and your Office is 64 bit then you need  64 bit Access driver(Provider)

     if you have 64bit  OS and your Office is 32 bit then you need  32 bit Access driver(Provider)

     if you have 32bit  OS and your Office is 32 bit then you need  32 bit Access driver(Provider)

    Check all your .NET solution if its pointing 64 bit.


    Thank you for your reply!

    I'm sure my program, OS and Office or Access runtime are all 64 bit.

    My program has 32 and 64 bit two versions, it runs well except failed in C2R Office or Runtime environment.

    Monday, September 9, 2019 8:00 AM
  • If everything is set 64bit does it run well ?

    Probably you need to switch the provider based on what driver is registered.

    Monday, September 9, 2019 8:10 AM
  • In a ClickToRun installation, the Registry is sandboxed, so search these two keys for the settings:

    HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY
    
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY



    Gustav Brock

    Monday, September 9, 2019 8:13 AM
  • In a ClickToRun installation, the Registry is sandboxed, so search these two keys for the settings:

    HKEY_CURRENT_USER\Software\Classes\VirtualStore\MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY
    
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY



    Gustav Brock

    Thank you for your prompting!

    I found the ACE keys in registry, but it's still failed when I change "Jet OLEDB:Registry Path" to new path, and got same error "Microsoft.ACE.OLEDB.16.0 is not registed".

    Wednesday, September 11, 2019 7:52 AM
  • You may have to run a separate install of ACE:

    Microsoft Access Database Engine 2016 Redistributable


    Gustav Brock

    Friday, September 13, 2019 6:48 AM
  • I already cloned ACE registry keys of OS where Access 2016 MSI version installed to the current OS where Access 2019 C2R version installed, and copied ACE engine DLL files of 2019 to the usual folder which recorded in registry key.

    Then I runned my application, error "The operating system is not presently configured to run this application." was instead of error "Microsoft.ACE.OLEDB.16.0 is not registered.", and the dialogue form could not be closed.

    Well, I give up.


    • Edited by 麦田圈 Wednesday, September 18, 2019 1:51 AM wrong type
    Wednesday, September 18, 2019 1:48 AM
  • I'm having a similar issue.  I have a new Dell Xps, Office 365, everything is 64 bit.

    I downloaded VS 2019 and every time I try to add an access database, VS wants to use Microsoft.Ace.12.0

    I've tried to download access 2016, but that doesn't install if you have office 365 (C2R).  No other versions of Access will install if you're using Office 365 (C2R).

    I think a possible answer is to uninstall Office 365, install access 2016.

    But this totally sucks as a solution.  It seems that MS is no longer supporting Access with VS.

    Why can't they supply a 32/64bit driver for Access as part of the installation?  

    I'm stuck.... I've looked into alternatives to Access but they too require Microsoft.Ace.12.0.

    What do I need to do to VS to make it look for Microsoft.Ace.16.0?  Mine VS only looks for Microsoft.Ace.12.0.

    Tuesday, November 26, 2019 1:37 PM
  • You should (have to) be able to install the ACE data engine.

    Try this link:

    https://www.microsoft.com/en-us/download/details.aspx?id=54920

    Note there are two versions. A x32,  and the x64 version.

    Try installing the x64 bit version if you are REALLY sure. But launch word, or excel or Access and check the bit version you are running (it takes less then 1 minute to check this).

    So from say Access or most of office go file->account. Then click on "About Access". It will given you version information, and also the bit version.

    Once you install the ACE engine, then your connection should work. Note that if you REALLY are using x64 bits, then you have to force  your .net  project to x64. And also note that if you use ANY of the built in connection string builders in VS, the test connection button will fail, since VS is a x32 bit product. So you can use the connection string wizards and builders from VS during development, but the test connection option will fail. However, if your project is set to x64, then running it should work fine. You can't use ANY CPU, as that will during development result in a x32 bit running process because VS as noted is x32. However, if you set the project to x64, then when the program is launched (even as debug mode), it will result in a x64 bit running process.

    Regards,

    Albert D. Kallal (Access MVP 2003-2017)

    Edmonton, Alberta Canada

    Tuesday, November 26, 2019 6:18 PM