I ran into an error today involving connecting to a Microsoft Access database. I avoid Access like the plague. In this case, the program involves converting data in an Access database to a next generation system with a SQL Server database. Therefore, using Access is unavoidable.

I wired up my connections and got the appropriate connection strings using the old UDL trick. The connections tested successfully. However, the program would throw an InvalidOperationException when I tried to connect. The message within the exception is:

The 'Microsoft.ACE.OLEDB.12.0' provider is not registered on the local machine.

This is one instance where an error has a lot of website hits. Maybe too many (the irony of me adding to that is not lost on me). At the end it wasn't clear to me why it's a problem. I do have the full Office suite installed. My OS and Office installation is 64-bit. And my program is set to Any CPU.

I got my answer from a Social MSDN response. Specifically, the part where he said that the version for 2007 is what made it work for him. And it worked for me too.

I installed the Access 2007 database engine and my program works. An extra bonus is that it hasn't appeared to break my Office 2013 installation.