Share via

Access 2007 ADODB Connection Error “data source object is already initialized data source object is already initialized”

Anonymous
2012-05-12T00:42:32+00:00

I am trying to convert from Access 2000 to Access 2007.  I have run into an issue with the ADODB CurrentProject.Connection.

I create a mdb database (Test_mdb.mdb)  and add the following procedure straight out of MSDN Connecting to the Current Access Database by Using ADO (Office 2000) http://msdn.microsoft.com/en-us/library/aa164887(v=office.10).aspx

Sub PrintCurrentConnectString() Dim cnnDB as ADODB.Connection     ' Get connection to current database.     Set cnnDB = CurrentProject.Connection     Debug.Print cnnDB.ConnectionString     Set cnnDB = Nothing End Sub

When I execute the procedure I get the following error:

Window Title: Microsoft Visual Basic

Text: Run-Time error ‘-2147217838(80040e52)’:

Data source object is already initialized

If I create a project  adp database (Test_adp.adp) and add the same code it works and debug.print shows

Provider=Microsoft.Access.OLEDB.10.0;Persist Security Info=False;Data Source=A75\MSSMLBIZ;Integrated Security=SSPI;Initial Catalog=SalesDB;Data Provider=SQLOLEDB.1

I’ve found a number of threads on “data source object is already initialized data source object is already initialized” but none have proved to be the solution.

The reference libraries I’m using in the above are:

Visual Basic for Applications

Microsoft Access 12.0 Object Library

OLE Automation

Microsoft ActiveX Data Objects 2.1 Library

Microsoft DAO 2.6 Object Library

Microsoft ADO Ext. 2.8 for DDL and Security

Microsoft Office 14.0 Object Library

I’m not sure why I only can choose Microsoft Office 14.0 Object Library as I thought this was for Office 2010 and I’m running Office 2007.  I tried to Register the Microsoft Office 12.0 Object Library but keep getting an error message.

regsvr32 "C:\Program Files\Common Files\Microsoft Shared\OFFICE12\mso.dll"

Get C:\Program Files\Common Files\Microsoft Shared\OFFICE12\mso.dll was loaded, but the DllRegisterServer entry point was not found.  The file can not be registered.

Any assistance would be greatly appreciated

Frank

Microsoft 365 and Office | Access | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

2 answers

Sort by: Most helpful
  1. Anonymous
    2012-05-15T02:14:50+00:00

    Thanks Nathan,

    I will try the hot fix first and then if that doesn't work SP3.

    I'll keep the forum posted.

    Frank

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2012-05-14T22:00:29+00:00

    Do you have any Office 2010 products installed on this machine?  If so, you could try installing the fix in the following article to see if it helps or install SP3 for Office 2007:

    2512789          Description of the Office Access 2007 hotfix package (ace-x-none.msp, access-x-none.msp): April 26, 2011

    http://support.microsoft.com/kb/2512789/EN-US

    Best Regards,

    Nathan O.

    Microsoft Online Community Support

    Was this answer helpful?

    0 comments No comments