Microsoft.ACE.OLEDB.12.0 on different machines

Joined
Mar 14, 2014
Messages
12
Programming Experience
10+
I have written a VB.net 2013 program on a machine with office 2013 using Microsoft.ACE.OLEDB.12.0. Now I want to rein it on two other computers: one - and older 32 bit computer with windows xp and no Access installed, and two - a new 64 bit laptop with access 2013 installed. Can someone point me to the downloads I need to install to make this work?
 
Compile a 32 bits version and a 64 bits version (IF you have Office 64 bits on one of them, otherwise just 32 bits would be fine....) , and copy the ACE interop to your output.
 
To change your build platform, in the top toolbar where it says Release or Debug, click the combo box and select Configuration Manager. You will be able to add the project configuration you want in the next screen.

As for the interop, in your project properties in the References, select your ACE reference and in its properties set Copy To Output to True.
 
As a sidenote, for the computer that doesn't have office installed you might have to include the ACE redistributable, as it is probably not installed either.
 
Almost everyone who has Office installed will have the 32-bit version installed. That's what gets installed by default and Microsoft recommend only installing the 64-bit version if you specifically need one of the very few extra features it provides. As you can only have one of the 32-bit and 64-bit versions of ACE installed at a time, you should recommend to your users who don't have Office to install the 32-bit version of ACE, in case they do need to install Office in the future. That means that the vast majority, if not all, your users will using 32-bit ACE, even on 64-bit Windows.

What this means for you is that you should be setting your Target Platform to x86 or, if available, set the Target Platform to Any CPU and check the Prefer 32-bit box. That way, your app will run in a 32-bit process on every machine. If you do need to be able to support 64-bit ACE then you should build a second version of your app with the Target Platform set to x64. You can then provide your users with a choice between 32-bit and 64-bit versions of your app, as I'm sure that you've seen elsewhere, and let them know under which circumstances to choose each.
 
That helps! I'll stick with the 32. If I understand correctly, I should only need the interop files when using automation. For example, opening excel, manipulating cells, and closing. With access, I am only using oledb to query data, so the ACE distributable should be all I need. Is that correct?
 
That helps! I'll stick with the 32. If I understand correctly, I should only need the interop files when using automation. For example, opening excel, manipulating cells, and closing. With access, I am only using oledb to query data, so the ACE distributable should be all I need. Is that correct?

That's correct. If you want to perform Office Automation, i.e. remote control an instance of an Office application, then that Office application must be installed and you need an Interop assembly so that your own .NET code can interoperate with the Office COM code. If you're using System.Data.OleDb to connecto to an ACCDB database then you need ACE installed because ACE includes the required OLE DB provider. ACE can be installed with Office or standalone.
 
Back
Top