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?
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.
User contributions licensed under CC BY-SA 3.0