Answer the question
In order to leave comments, you need to log in
C# throws an error when working with Interop. What to do?
The target machine does not have the required version of Access (it costs 2010) and I installed Access 2016 Runtime there.
When I try to run the program, I get the following error:
System.Runtime.InteropServices.COMException (0x80080005): Retrieving the COM class factory for component with CLSID {73A4C9C1-D68D-11D0-98BF-00A0C90DC8D9} failed due to the following error: 80080005 Error while executing the server application (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE)). at System.Runtime.Remoting.RemotingServices.AllocateUninitializedObject(RuntimeType objectType) at System.Runtime.Remoting.Activation.ActivationServices.CreateInstance(RuntimeType serverType) at System.Runtime.Remoting.Activation.ActivationServices.IsCurrentContextOK(RuntimeType serverType, Object[] props , Boolean bNewObj) at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.
at System.Activator.CreateInstance(Type type, Boolean nonPublic) at System.Activator.CreateInstance(Type type) at .Clacess.AccessProvider..ctor(String pathToDatabase) in ... Tell me
, what could be causing this error?
I use either version 15.0.0.0.
The error occurs in the method that creates the Application object and tries to open the Access DB...
Access 2016 Runtime is not enough to create the object?
Tell me what to do with it? Do not offer to work through Oledb.
Answer the question
In order to leave comments, you need to log in
Obviously, you need to install Access of the desired version, the same as runtime
If you use the functionality that is present in Access 2016 and Access 2010, then you can manually write (without references) loading the Access library through the same System.Activator.CreateInstance using Dynamic (I suspect that your version of .NET already supports this). There is an example on the toaster, although Excel is used there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question