How to solve this error caused due to the Microsoft.Office.Interop.Access.ApplicationClass?

2

When i am working on COM Component Access I am getting this error.

Unable to cast COM object of type 'Microsoft.Office.Interop.Access.ApplicationClass' to interface type 'Microsoft.Office.Interop.Access._Application'.

This operation failed because the QueryInterface call on the COM component for the interface with IID '{68CCE6C0-6129-101B-AF4E-00AA003F0F07}' failed due to the following error: Error loading type library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRARY)).

Actually its a Migrated Project from B 6.0 to VB.NET.

Can any one help me?

vb.net
vb6-migration
asked on Stack Overflow Apr 18, 2012 by Hemant Kumar • edited Feb 12, 2020 by Olivier Jacot-Descombes

1 Answer

1

Sometimes, the MS Access Interop (and interops in general) are not compatible with 64-bit executables. Changing your project compile type to "x86" fixed this issue for me. The default is "Any CPU", which means you could be running it in 64-bit mode, which won't be compatible with your interop.

Another possibility is that your COM library version doesn't match the version which you have installed on your CPU. This can happen when two different developers of the same project don't have the same version of Access. This is less likely but still a possibility.

answered on Stack Overflow Jul 30, 2014 by nuzzolilo

User contributions licensed under CC BY-SA 3.0