none
adodb class not registered RRS feed

  • Question

  • Hi!

    On Windows 7 64bit. When I (in Visual Studio 2010 Express, using VB.Net) try to create an adodb connection (Microsoft ActiveX Data Objects Library 6.0 is referenced, and ADODB imported) I get:

    Retrieving the COM class factory for component with CLSID {00000514-0000-0010-8000-00AA006D2EA4} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).

    I have a purchased application which I believe was working before, but now throws the same error, it can't create the connection. The supplier uses adodb, and say that my DAC installation is corrupt.

    The problem may have started after I ran a registry cleaner.

    Any ideas?? (Other than reinstalling all of Windows)

    Brgds

    Danny

     

    Friday, October 7, 2011 9:11 AM

All replies

  • That particular CLSID is referring to the ADO Connection Class so it does look like it got wacked. What you could try is re-registering the ADO library (msado15.dll), assuming that it still exists. Just make sure to run the Regsvr32 utility under an elevated command prompt (Run as administrator).

    http://support.microsoft.com/kb/833220

    For 32-bit ADO (under 64-bit Windows) the path to msado15.dll is the same but under Program Files (x86). Also for 32-bit COM component registration you need to use the 32-bit version of Regsvr32 under Windows/SysWOW64.

    Unfortunately, I'm not aware of any way to re-install MDAC under Windows 7.


    Paul ~~~~ Microsoft MVP (Visual Basic)
    Friday, October 7, 2011 4:38 PM
  • Hi!

    Thank you, that was very helpful. It is a month old problem now. The supplier just keeps saying to reinstall MDAC and sending me links on how to do that under XP. I tried my luck under the Windows 7 Installation/Setup forum, but keep getting unhelpful suggestions there.

    I tried re-registering, but it's still the exact same message. Should the PC be rebooted after? Registering said it was 'successful'. This is what I did:

    1. Navigated in Explorer to C:\Windows\SysWOW64
    2. Ran regsvr32.exe as Administrator
    3. Entered .\regsvr32.exe "C:\Program Files (x86)\Common Files\System\ado\msado15.dll"

    That is also the path I've referenced to in Visual Studio, and the file is there.

    Brgds

    Danny

    Friday, October 7, 2011 5:36 PM
  • The above method is correct if the app is running 32-bit.

    By default Visual Studio Express will compile apps for the "Any CPU" platform. That means apps will run 64-bit under 64-bit Windows. Did you change the Platform option? If not then you probably need to try and re-register the 64-bit version of ADO.

    The ADO reference in your project should probably be set to "Microsoft ActiveX Data Objects 6.0 Library" (or the Microsoft ActiveX Data Objects 6.0 BackCompat Library if developing under Windows 7 SP1).


    Paul ~~~~ Microsoft MVP (Visual Basic)
    Friday, October 7, 2011 5:54 PM
  • Hi!

    I haven't changed my Platform Option, I don't even know where it is - just looked around, could not see one.

    What's the 64-bit version of ADO then? I'm already referencing "Microsoft ActiveX Data Object 6.0 Library". I don't see any "Microsoft ActiveX Data Object 6.0 BackCompat Library", or indeed anything else called ADO, but it is difficult to see with all the thousands of references there. I am using Windows 7 SP1.

    Brgds

    Danny

    Friday, October 7, 2011 6:33 PM
  • Ah, you are using Windows 7 SP1. The type library that shipped with Windows 7 SP1 introduced a breaking change, that is not compatible with type libraries created in previous editions.

    Try uninstall SP1, hack the type libraries or compile your code on Windows 8 Developer preview

    By the way, your way of using ADO is not supported by Microsoft, as ADO is not recommeneded for use in managed code.



    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Friday, October 7, 2011 6:45 PM
  • In the Express version the Platform is somewhat hidden and you can't see the Build menu item. If I remember you have to do the following:

    Tools...Settings...and select Expert Settings. Then you should see the Build menu item.

    Select Build...Configuration Manager and then you can change the Platform option. If it's x86 then the app compiles and runs 32-bit on both 32-bit and 64-bit systems. If it's Any CPU then it runs 32-bit on 32-bit systems and 64-bit on 64-bit systems.

    In the References there is no distinction between 32-bit and 64-bit ADO (except they are version 6.0). Support is transparent and the underlying file library that is used depends upon whether the app is running 32-bit or 64-bit.


    Paul ~~~~ Microsoft MVP (Visual Basic)
    Friday, October 7, 2011 7:11 PM
  • In the Express version the Platform is somewhat hidden and you can't see the Build menu item. If I remember you have to do the following:

    Tools...Settings...and select Expert Settings. Then you should see the Build menu item.

    Select Build...Configuration Manager and then you can change the Platform option. If it's x86 then the app compiles and runs 32-bit on both 32-bit and 64-bit systems. If it's Any CPU then it runs 32-bit on 32-bit systems and 64-bit on 64-bit systems.

    In the References there is no distinction between 32-bit and 64-bit ADO (except they are version 6.0). Support is transparent and the underlying file library that is used depends upon whether the app is running 32-bit or 64-bit.


    Paul ~~~~ Microsoft MVP (Visual Basic)

    Hi!

    I selected Expert Settings, but under the Build item in the main menubar, I still only have Build and Publish, no Configuration Manager. In any event, since I've never changed it, it should remain as the default "Any CPU" right?

    I found a second msado15.dll under Program Files, I assume that is the 64 bit version. I registered that too, but it still comes up with the same message of the class not being registered, and on the same class ID.

    Brgds

    Danny

    Saturday, October 8, 2011 9:27 AM
  • Ah, you are using Windows 7 SP1. The type library that shipped with Windows 7 SP1 introduced a breaking change, that is not compatible with type libraries created in previous editions.

    Try uninstall SP1, hack the type libraries or compile your code on Windows 8 Developer preview

    By the way, your way of using ADO is not supported by Microsoft, as ADO is not recommeneded for use in managed code.



    Hi!

    It's not actually me who is using adodb. I've purchased a software that won't run because it throws this error message. Their support says that as long as I can't create an adodb connection in Visual Studio myself, my Windows installation is corrupt and it is out of their hands. I have to resolve the Windows problems myself.

    Now, your article says "An ADO application does not run on down-level operating systems after you recompile it on a computer that is running Windows 7 SP 1 or Windows Server 2008 R2 SP 1 or that has KB983246 installed". Now, this is not a recompilation for an earlier operating system, the supplier tells me they are using Windows 7 SP1, and I am using Windows 7 SP1 too. Besides in my own test I created that VB.Net application just now, so Windows 7 SP1 from scratch.

    Brgds

    Danny

     

    Saturday, October 8, 2011 9:39 AM
  • Hi,

     Right click your project--->property:

    Have a nice day.


    Alan Chen[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, October 10, 2011 7:12 AM
    Moderator
  • Hi!

    There is no Build tab in Express. Only Compile, which doesn't have Platform Target, although it does have Framework Target.

    Brgds

    Danny

    Monday, October 10, 2011 7:32 AM
  • I think there is one other setting that needs to be changed: Tools...Options...Projects and Solutions and enable the Show advanced build configurations option. Yes, Any CPU is the default Platform.

    I'm not sure what other options there are to fix MDAC/WDAC under Windows 7. You might want to try running the System File Checker:

    How to use the System File Checker tool to troubleshoot missing or corrupted system files on Windows Vista or on Windows 7


    Paul ~~~~ Microsoft MVP (Visual Basic)
    Monday, October 10, 2011 12:25 PM
  • Hi!

    Yes, then it shows Configuration Manager under Build (but still no Build tab in project properties)

    However, it says x86 for Active Solution Platform AND Build Platform, not Any CPU. Should I change that? To Any or x64? I am running 64 bit so I don't understand why it is using x86. Active to x64 and Build to Any perhaps?

    I ran sfc a month ago, it found no problems.

    Brgds

    Danny

    Monday, October 10, 2011 12:54 PM
  • That is correct. There is no Build tab. The Platform option is under Configuration Manager. If it's set to x86 then your app is running 32-bit (in WoW64). If you change it to Any CPU or x64 it will run 64-bit. You can try running it 64-bit as long as you aren't using any 32-bit components.


    Paul ~~~~ Microsoft MVP (Visual Basic)
    • Proposed as answer by Alan_chenModerator Tuesday, October 18, 2011 3:25 AM
    • Unproposed as answer by dbjorck Tuesday, October 18, 2011 7:13 AM
    Monday, October 10, 2011 1:03 PM