Tutorial :.NET Access automation with Access 2007 Runtime


I'm having trouble deploying .NET application which uses Microsoft Access automation.

I've installed the Access 2007 Runtime and Primary Interop Assemblies (PIAs) on the target machine:

Access 2007 Runtime

Office 2007 PIAs

However, when I try to create the ApplicationClass:

Application access = new ApplicationClass();  

I get the following exception:

Unhandled Exception: 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.

I've googled the error code and tried tweaking the security settings in dcomcnfg, to no avail.

Any ideas?

I don't want to install the full version of Access due to the cost, and the runtime should at least be able to create an instance of the application, surely?


You can’t launch an automated instance of the access runtime. What happens is access does start up when the instance is created. However, because it is the runtime, access then shuts down. In other words, you HAVE to open a database for the runtime to stay open.

Since one can not supply the file name to open with automation, then the work around is to use the Shell() function. Launch a copy of ms-access via shell() and this allows you to supply the accDB or mdb file as a parameter in the shell command. Then, in your .net code, use the equivalent of a get object in place of create object.

So this same limitation exists for access developers when we attempt to automate ms-access in a runtime. You can't create the instance in code. However, as above shows, you have to use Shell() due to the above limitation that the access runtime shuts down when launched without a file parameter.


The PIAs won't work with out the software that provides the interface to be installed.

If you do not want Access to be installed on your user's computers, you can

  • Rewrite the app to an Access application in VBA and deploy it with Access Runtime.
  • Use 2007 Office System Driver: Data Connectivity Components to access your database, however this engine does not expose many Access features such as reports, forms, functions in queries, etc.

If you switch to ODBC/OLEDB/ADO, I suggest you to upgrade to SQL Server Express, SQL Server Compact Edition or other free database software.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »