Results 1 to 12 of 12

Thread: [RESOLVED] Unable to connect to access DB

  1. #1

    Thread Starter
    Lively Member viper5646's Avatar
    Join Date
    Feb 2009
    Location
    kitchener Ontario
    Posts
    90

    Resolved [RESOLVED] Unable to connect to access DB

    Hi all
    I currently have an application built using any cpu platform.
    This application works fine in win7 x86.The User has upgraded their pc to windows 10 pro x64 bit with office 365.
    The application installs fine and opens the only thing is that it wont connect to the access 2010 database, I receive the following error 'Microsoft.Ace.oledb.12.0 provider is not registered on local machine.
    I have installed access2010 runtime x64 and still am having the same error, I can only install x64 because the user has access 365 which is x64 and it wount let me install the access runtime x86.


    Thanks in advance.

  2. #2
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    25,481

    Re: Unable to connect to access DB

    You need to target x86. It'll work fine in 32 and 64 bit PCs

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: Unable to connect to access DB

    When you select the Any CPU platform, you can also check or not check the Prefer 32-bit box. If that box is checked, it means the application will run in a 32-bit process if it possibly can, even on a 64-bit edition of Windows. Consumer editions of Windows will support 32-bit processes so, if that box is checked, your application will run in a 32-bit process on most Windows installations, whether 32-bit of 64-bit.

    If this user is going to have 64-bit ACE installed then you need your application to run in a 64-bit process, so you need to either uncheck that Prefer 32-bit box or else select x64 as the platform. If you need to build two editions of your application - one 32-bit and one 64-bit - then so be it.

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: Unable to connect to access DB

    Quote Originally Posted by .paul. View Post
    You need to target x86. It'll work fine in 32 and 64 bit PCs
    But if the edition of ACE that's installed is 64-bit then targeting x86 won't help because that will make the application 32-bit. I think the application already is 32-bit anyway, because Any CPU with Prefer 32-bit checked is the default, and that's the actual issue.

  5. #5
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,543

    Re: Unable to connect to access DB

    I thought the problem was that despite being a 64-bit system, the ACE drivers being installed were only 32-bit, which is why it claims it isn't installed because it's trying to look for the 64-bit version, and not finding it, errors out. Or did that get "resolved"? I don't normally deal with Access dbs, and it's been sometime since I have, so I may be out dated on my info.

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  6. #6
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: Unable to connect to access DB

    Quote Originally Posted by techgnome View Post
    I thought the problem was that despite being a 64-bit system, the ACE drivers being installed were only 32-bit, which is why it claims it isn't installed because it's trying to look for the 64-bit version, and not finding it, errors out. Or did that get "resolved"? I don't normally deal with Access dbs, and it's been sometime since I have, so I may be out dated on my info.

    -tg
    The OP says that x64 Office was already installed and x64 ACE was installed, so the app must be x86 if it can't find ACE. The default platform for a WinForms application project has changed in VS over the years but the 2017 default is Any CPU and Prefer 32-bit, so the application would be 32-bit on any consumer edition of Windows, whether 32-bit or 64-bit. Those two facts indicate that the application is 32-bit while ACE is 64-bit, which the opposite of the usual problem people have connecting to Access databases. In that case, the solution is to make the app 64-bit, which means unchecking the Prefer 32-bit box or targeting the x64 platform.

  7. #7
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: Unable to connect to access DB

    Quote Originally Posted by viper5646 View Post
    I have installed access2010 runtime x64
    By the way, if you really have installed the Access runtime then that was overkill. All you needed was the Access engine. The runtime is to allow actual Access applications to execute without Access installed, while the engine is all that's required to connect to a data file. Check out the two downloads below and note the size difference.

    Microsoft Access 2010 Runtime
    Microsoft Access Database Engine 2010 Redistributable

  8. #8

    Thread Starter
    Lively Member viper5646's Avatar
    Join Date
    Feb 2009
    Location
    kitchener Ontario
    Posts
    90

    Re: Unable to connect to access DB

    thanks All for your Help
    By Targeting X86 and using Access engine x86 it works fine on a test pc (win 7 x64).
    I still have the issue that the user has x64 office products and I'm not able to install x86 where x64 office products are installed.
    I also tried access engine x64 but it did not work.

  9. #9
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: Unable to connect to access DB

    Quote Originally Posted by viper5646 View Post
    I still have the issue that the user has x64 office products and I'm not able to install x86 where x64 office products are installed.
    Then you haven't read my replies properly.

    If this user is going to have 64-bit ACE installed then you need your application to run in a 64-bit process, so you need to either uncheck that Prefer 32-bit box or else select x64 as the platform. If you need to build two editions of your application - one 32-bit and one 64-bit - then so be it.
    Someone else was asking a related question earlier today and you might benefit from reading the answer I provided there:

    http://www.vbforums.com/showthread.p...ution-Platform

  10. #10

    Thread Starter
    Lively Member viper5646's Avatar
    Join Date
    Feb 2009
    Location
    kitchener Ontario
    Posts
    90

    Re: Unable to connect to access DB

    I rebuild the app with any cpu selected and 32bit unchecked.
    The program worked fine with access 2010 Engine x32, but when I tryed with x64 if failed with the same error.
    I also tryed the Redistributable version and no luck.
    No matter what I try it only works with x32 Ace
    Last edited by viper5646; Jul 13th, 2018 at 10:49 PM.

  11. #11
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    110,350

    Re: Unable to connect to access DB

    I'm not really sure how that can be but I'm not in a position to test myself with different editions of ACE. The first thing I'd do is check Task Manager to see whether the app is 32- or 64-bit in each case.

  12. #12

    Thread Starter
    Lively Member viper5646's Avatar
    Join Date
    Feb 2009
    Location
    kitchener Ontario
    Posts
    90

    Re: [RESOLVED] Unable to connect to access DB

    Thanks all for all of your help.
    The ACE is working fine.
    The issue was where the DB was.
    I had the C:\Users\Username\Documents\ Where the user had administrator privileges.
    After I moved the DB to the Public folder the ACE worked fine.
    Sorry if you see duplicate posts as after posting the first one I went to mark it as solved the post disapeared so I post it again.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width