title: System.Runtime.InteropServices.COMException (0x80040154) - Microsoft DAO 3.6
body: <p>Is this a problem with compilation for a target processor or DLL registration?</p>
  
  <p>I developed an application in Microsoft Visual Basic 2008 Express Edition. It references the Microsoft DAO 3.6 Object Library (Interop.DAO.dll). The application runs on XP and 32-bit Vista but on 64-Bit Win7 an exception is raised with the text
  System.TypeInitializationException: The type initializer for 'Mohr10.TestUtils' threw an exception. 
  ---> System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {00000100-0000-0010-8000-00AA006D2EA4} failed due to the following error: 80040154.</p>
  
  <p>The error comes from the source code line</p>
  
  <pre><code>   Dim DAODbEngine As New DAO.DBEngine
  </code></pre>
  
  <p>My searches have shown me to look at 2 items:</p>
  
  <ol>
  <li><p>The DLL is 32 bit, so I should compile for Platform x86. The Platform drop-down list on the Compile tab, however, only has "Ative (Any CPU)".</p></li>
  <li><p>I should run regsvr32 interop.dao.dll
  This doesn't work - it gives
  The module "interop.dao.dll" was loaded but the entry-point DllRegisterServer was not found.
  Make sure that "interop.dao.dll" is a valid DLL or OCX file and then try again.</p></li>
  </ol>
  
  <p>The command regasm interop.dao.dll
  gives
  "Microsoft (R) .NET Framework Assembly Registration Utility 2.0.50727.5420
  Copyright (C) Microsoft Corporation 1998-2004.  All rights reserved.</p>
  
  <p>Types registered successfully"</p>
  
  <p>but the program still doesn't work and regsvr32 gives the same message.</p>
  
  <p>I don't know how to run C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\regasm with the /tlb option because I can't seem to find a .TLB file.</p>
  
  <p>My searches for solutions have remained fruitless, so I'd appreciate some help.</p>