-
Jul 9th, 2018, 08:19 PM
#1
Thread Starter
Lively Member
[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.
-
Jul 9th, 2018, 10:20 PM
#2
Re: Unable to connect to access DB
You need to target x86. It'll work fine in 32 and 64 bit PCs
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jul 9th, 2018, 10:24 PM
#3
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.
-
Jul 9th, 2018, 10:27 PM
#4
Re: Unable to connect to access DB
Originally Posted by .paul.
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.
-
Jul 10th, 2018, 07:24 AM
#5
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
-
Jul 10th, 2018, 08:14 AM
#6
Re: Unable to connect to access DB
Originally Posted by techgnome
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.
-
Jul 10th, 2018, 08:21 AM
#7
Re: Unable to connect to access DB
Originally Posted by viper5646
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
-
Jul 10th, 2018, 08:22 PM
#8
Thread Starter
Lively Member
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.
-
Jul 10th, 2018, 08:42 PM
#9
Re: Unable to connect to access DB
Originally Posted by viper5646
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
-
Jul 13th, 2018, 10:37 PM
#10
Thread Starter
Lively Member
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.
-
Jul 14th, 2018, 01:17 AM
#11
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.
-
Jul 14th, 2018, 01:07 PM
#12
Thread Starter
Lively Member
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|