question

Jackson1990-7147 avatar image
0 Votes"
Jackson1990-7147 asked Jackson1990-7147 commented

Issue to ACE.OLEDB

Hi,
For issue below

[InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.]

Is this a version issue and server machine must be with 32-bit version of Microsoft.ACE.OLEDB.12.0?

dotnet-csharpoffice-access-dev
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

vb2ae avatar image
0 Votes"
vb2ae answered

The error is saying it does not have the Microsoft.Ace.OLEDB.12 drivers installed. If you have a 64bit computer you need to install the 64-bit version of Microsoft.Ace.OLEDB.12. It will install the 32 bit version also.


https://www.microsoft.com/en-US/download/details.aspx?id=13255


5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Jackson1990-7147 avatar image
0 Votes"
Jackson1990-7147 answered

Hi,
I've set up 32 bit version (of ACE.OLEDB) but there is still error below

[InvalidOperationException: The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.]
System.Data.OleDb.OleDbServicesWrapper.GetDataSource(OleDbConnectionString constr, DataSourceWrapper& datasrcWrapper) +258
System.Data.OleDb.OleDbConnectionInternal..ctor(OleDbConnectionString constr, OleDbConnection connection) +497
System.Data.OleDb.OleDbConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject) +100
System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup, DbConnectionOptions userOptions) +57
System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) +1142
System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions) +312
System.Data.ProviderBase.DbConnectionInternal.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +23
System.Data.OleDb.OleDbConnection.Open() +52

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TimonYang-MSFT avatar image
0 Votes"
TimonYang-MSFT answered

Also pay attention to the version of your application, 64-bit applications cannot use 32-bit Microsoft.ACE.OLEDB.12.0.

The default application created by Visual Studio is Any CPU but 32-bit is preferred. If you download a 64-bit OLEDB, you need to modify your application to X64, and vice versa.

97381-1.png


If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


1.png (1.8 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Jackson1990-7147 avatar image
0 Votes"
Jackson1990-7147 answered Jackson1990-7147 commented

Hi,
I've changed Platform target to be X86 and have re-compiled project but then I've got issues below:

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace:

[BadImageFormatException: Could not load file or assembly 'RegRec2' or one of its dependencies. An attempt was made to load a program with an incorrect format.]
System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0
System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +225
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +110
System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection) +22
System.Reflection.Assembly.Load(String assemblyString) +34
System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +48


· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

It seems that some packages in your program must be in a 64-bit environment.
Try to download the 64-bit OLEDB in the link provided by vb2ae, and then change X86 to X64 to see if it works.

0 Votes 0 ·

Hi,
Yes, I also tried to choose 64-bit version of ACE.OLEDB, but I encountered issue saying that my Office version is 32-bit. Which 64-bit Access version is better to use? Where to get it?

0 Votes 0 ·

Hi,
As new Office version is not available to MSDN subscription, is there separate link to only buy Access 2016 (not whole Office)?

0 Votes 0 ·

In my impression, it seems that it cannot be downloaded separately, but I am not sure. You can confirm it in Microsoft Community.

0 Votes 0 ·

Hi,
Any other help to buy Office 2016?

0 Votes 0 ·

Just like you, I'm just an ordinary user of office, and I have limited understanding of this.
I suggest you go to the forum I mentioned to ask for help from office experts.

0 Votes 0 ·