Acc: Connection Error when using CurrentProject.Connection or CurrentDB.Connection


Symptoms


When you open your database in Access you receive an error "Method 'Connection' of object '_Current Project' failed. This failure occurs when the VBA Application.CurrentProject.Connection or Application.CurrentDB.Connection is called.

Cause


The Access Database Engine/Access Connectivity Engine (ACE) is included with a number of products other than Microsoft Access such as Microsoft Visio and Microsoft Project. If you install a version of ACE that's different than that of Access, the ACEOLEDB.DLL path in the registry may not point to the corresponding ACE version.

Resolution


You should be able to resolve this issue by running a repair of the Office or Access installation.

Alternatively, you can modify the registry key changing the dll path to match that of your Access version.

Access 2007 - OFFICE12, Access 2010 - OFFICE14, Access 2013 - OFFICE15 and Access 2016 - OFFICE16

 

MSI Installations: 

(OS: 64bit Office: 64bit) or (OS: 32bit Office: 32bit)

Key: HKCR\CLSID\{3BE786A0-0366-4F5C-9434-25CF162E475E}\InprocServer32\

Value Name: (Default)

Value Data: C:\Program Files\Common Files\Microsoft Shared\OFFICE15\ACEOLEDB.DLL

 

(OS: 64bit Office: 32bit)

Key: HKCR\Wow6432Node\CLSID\{3BE786A0-0366-4F5C-9434-25CF162E475E}\InprocServer32\

Value Name: (Default)

Value Data: C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE15\ACEOLEDB.DLL

 

Click-2-Run Installations:

(OS: 64bit Office: 64bit) or (OS: 32bit Office: 32bit)

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Classes\CLSID\{3BE786A0-0366-4F5C-9434-25CF162E475E}\InprocServer32

Value Name: (Default)

Value Data: C:\Program Files\Common Files\Microsoft Shared\OFFICE15\ACEOLEDB.DLL

 

(OS: 64bit Office: 32bit)

Key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\ClickToRun\REGISTRY\MACHINE\Software\Classes\Wow6432Node\CLSID\{3BE786A0-0366-4F5C-9434-25CF162E475E}\InprocServer32

Value Name: (Default)

Value Data: C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE15\ACEOLEDB.DLL