回答済み Need help with COM Object

  • 5 aprilie 2012 22:18
     
     

    Hello all,

    My works vb app has quite a bit of COM and .NET Object references, and I cannot get the app to debug due to the fact that a COM Object is missing.

    Well, its not missing, but when I right click on my solution in VS 2010, and click on properties, go to the "References" tab, I see this COM object:

    Microsoft DAO 3.6 Object library

    And its path says this: "The system cannot find the reference specified"

    Here is what I have already done to try and fix the issue:

    1. I registered the dao360.dll with regsvr32.

    2. I deleted and readded the reference to this dll in VS2010.

    3. I deleted the reference's path, browsed for the file and readded the path.

       ALL of these solutions I have tried have FAILED. And i am pretty frustrated because this issue should never have came up if the ORIGINAL developer would have upgraded the program properly. I.E. This is not my program, I did not create it, I am simply improving it by debugging it, but obviously I cannot debug because of this issue.

       I hope someone can help me in a timely fashion. I will continue to believe that all hope is not lost yet. Thanks for your time and effort in trying to help me out.

Toate mesajele

  • 9 aprilie 2012 00:12
     
     

    Hi, when you registered dao360.dll, did you run the command window as administrator when you ran regsrv32. If you run regsvr32 from the run dialog, although it may say that it is registered, it may not register the dll correctly.

    Also, are you running 32 bit or 64 bit? if your running 64 bit then select c:\windows\syswow64\dao360.dll 

  • 9 aprilie 2012 13:52
     
     
    If you are running 64-bit Windows, is the Platform option (Build...Configuration Manager...) set to x86?

    Paul ~~~~ Microsoft MVP (Visual Basic)

  • 10 aprilie 2012 14:15
     
     

    I apologize for not specifying that I am on a Windows 7 64-bit machine. But I cannot remember if I ran it as administrator or not, and considering this is the first time I have had to register a stupid dll file, I hope you can enlighten me further on how to properly unregister and re-register the dll on a 64-bit machine. Thanks for your help mate.

    Btw, there is not dao360.dll file in the C:\Windows\syswow64 folder. I can only find this file in the C:\Program Files (x86)\Common Files\microsoft shared\DAO folder.

  • 10 aprilie 2012 14:17
     
     
    It was set to Any. I then set it to x86, but nonetheless I still got the error about the system not being able to find the reference to dao360.dll
  • 10 aprilie 2012 15:16
     
     

    Hi, I just reference my DAO library and created an object from Program Files (x86)

    Open Visual Studio Command Prompt. Ensure that you run it as administrator

    regsvr32 /u C:\Program Files (x86)\Common Files\microsoft shared\DAO\dao360.dll

    then type:

    regsvr32 /i C:\Program Files (x86)\Common Files\microsoft shared\DAO\dao360.dll

    try then to execute your code


  • 10 aprilie 2012 15:54
     
     

    First, rupex,  thanks for helping me out with this brain crunching issue. This is what I did with your reply.

    1. Right-clicked on visual studio command prompt> Ran as admin

    2. typed : regsvr32 /u C:\Program Files (x86)\Common Files\microsoft shared\DAO\dao360.dll

    3. This error pops up:

    The module "C:\Program" failed to load.

    Make sure the binary is stored at the specified path of debug it to check for problems with the binary or dependent .dll files.

    The specified module could not be found.

    :\ wtf is going on?

    This is a really annoying issue and Its probably because the prev. dev. built the program on his laptop with VS 2003 or 2005, and the program is trying to reference his dao360.dll, Although deleting and re-adding the reference should have fixed that.

    ORRRRRRR

    my dao360.dll somehow got corrupted(But hopefully not)!

    Any suggestions?

  • 10 aprilie 2012 15:56
     
     

    Actually if you use regsvr32 you want to run it from the SysWOW64 folder (32-bit) under Windows 64-bit for 32-bit components.

    I usually run the Command Prompt:  Start Button...All Programs...Accessories...right click on Command Prompt and select "Run as administrator".


    Paul ~~~~ Microsoft MVP (Visual Basic)

  • 10 aprilie 2012 16:14
     
     

    Cut and paste the following into the command window:

    regsvr32 "C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll"

    Let me know what happens :)

  • 10 aprilie 2012 16:15
     
     
    It needs to be in quotes like above. In your attempt (which I take responsibility for) was trying to load C:\Program as a DLL. Oops
  • 10 aprilie 2012 16:48
     
     

    Thanks rupex, I totally forgot about adding the quotations. But I unregistered and re-registered the dao360.dll, went into vs2010, deleted the reference, tried to re add it and this is what I am currently getting:

    A reference to C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component. :/

  • 10 aprilie 2012 17:35
     
     

    Hi run this command. Notice the /i this time.

    regsvr32 /i "C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll"

    You will get an error when you register it this way but just click OK

    Go into your project and set a reference. It should allow you to do so

  • 10 aprilie 2012 17:37
     
     
    Unregister it first :)
  • 10 aprilie 2012 17:54
     
     

    I unregistered it and ran the command: regsvr32 /i "C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll"

    But the same error came up, stating that " the reference to the .dll could not be added. Please make sure that the file i accessible, and that it is a valid assembly or COM component"

    I can tell you that after performing the unregister and reregister of the .dll, when I go into vs2010, under my project, and try to add the reference, it is missing from the COM tab.

    You dont have to reboot after you unregister the dll right?Idk why this is happening, but Microsoft should of had this issue fixed already because I do not see how it is on my end of the spectrum. I have done the necessary steps that one must take to reregister a dll. Thanks for the help rupex(Im not giving up, just so flipping frustrated with this crap right now)!

  • 10 aprilie 2012 18:12
     
     

    It can be frustrating and no, you don't have to reboot.

    When I deregister dao360.dll and try to add a reference I see this message:

    look familiar?

    I then register dao360.dll with the /i option, like so:

    regsvr32 /i "C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll"

    I then get this error:

    Again, look familiar. Just click OK when this happens.

    I then run regsvr32 again without the /i option, like so:

    regsvr32 "C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll"

    After I have done this, dao360.dll reappears in my COM components list

    I can then go into Visual Studio and add a reference and it works fine.

    Back in the day, DAO was part of MDAC which was something you had to install yourself for data access. Now it's called WDAC and is installed as part of the operating system.

  • 10 aprilie 2012 18:16
     
     
    Also, just for good measure, before you go through the process again, copy dao360.dll from the program files (x86) folder and paste it into c:\windows\syswow64
  • 10 aprilie 2012 18:23
     
     

    after the unregister/register process is done, and I have copied dao360.dll into the syswow64 folder, should I add the reference(dao360.dll) that is in the syswow64 folder? Or still try to add the reference from its current location?(C:\Program Files (x86)\Common Files\Microsoft Shared\DAO folder)

    Thanks a lot for being so patient and understanding rupex! You have been very helpful throughout this entire process and it means a lot that your not like a lot of people that just give you a one time in general answer and leave you hanging.

  • 10 aprilie 2012 18:26
     
     

    Do not use /i when registering (it calls DllInstall which won't work). Below is the doc for regsvr32:

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

    Also, after removing any references from your project make sure to delete any interop files for DAO from your bin folder (if they exist).


    Paul ~~~~ Microsoft MVP (Visual Basic)

  • 10 aprilie 2012 18:27
     
     

    There are a couple of other things you can try as well:

    1. Open the folder that your project is in and navigate through the subfolders obj\x86\Debug (do this for obj\x86\Release if it's there). Delete the file Interop.DAO.dll

    2. Open a new console application (after following the steps in the previous posts) and try to add the reference to a new project

    I don't mean to banter on but I would like to see you fix your problem


  • 10 aprilie 2012 18:41
     
     
    Also, just for good measure, before you go through the process again, copy dao360.dll from the program files (x86) folder and paste it into c:\windows\syswow64

    The DAO library is installed, registered and referenced from a single location - Microsoft Shared. Moving it to SysWOW64 will not help.

    Paul ~~~~ Microsoft MVP (Visual Basic)

  • 10 aprilie 2012 18:45
     
     

    Heres what I did:

    1. Copied dao360.dll from \DAO folder to \Syswow64 folder

    2. Unregistered dll:

    regsvr32 /u "C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll"

    3. registered the dll:

    regsvr32 "C:\Program Files (x86)\Common Files\Microsoft Shared\DAO\dao360.dll"

    4. went back into VS2010, tried to add reference(1st time from \DAO folder, second time from \syswow64 folder.

    Both times I get the error message:

    "A reference to "location of dao360.dll" could not be added. Please make sure that the file is accessible, and that it is a valid assembly or COM component."

    5. Went into my projects bin and obj folders, deleted Interop.DAO.dll from \obj\release folder.(No file in \bin folder)

    At this point the reference is still not under the COM tab in VS2010:////

    6. Opened up a new project and tried to add the reference from a new project. It is not under the COM tab either, so I had to browse for the .dll. Same error still pops up.


  • 10 aprilie 2012 18:50
     
     

    Thanks for you input Paul.

    When I go through the process of deregistering dao360.dll from c:\program files (x86)\blah blah and try to reference it in a project, it obviously fails.

    When I register dao360.dll from the same location I deregistered it from and add a reference to dao360.dll in a project, it tells me that it's comming from SysWOW64. There are clearly two separate file there.

    Can you shed some light on this behavior?

  • 10 aprilie 2012 19:09
     
     
    fyi, I deregistered from c:\program files (x86)\blah blah and tried registering the dll in syswow64 folder. Still no luck. So right now, the dao360.dll is registered and located in c:\program files (x86)\Common Files\microsoft shared\DAO location.
  • 10 aprilie 2012 19:34
     
     

    I must add this link, been googling this issue all day. Please look at this link though:

    http://answers.microsoft.com/en-us/office/forum/office_2010-access/dao360dll-missing-in-64-bit-office-what-can-i-do/2a7ac137-eed3-4c75-aee9-6a102665e4fd

    (Insert link button is not working, please copy and paste url above in web browser:))

    But any who, I hope somebody can give me insight on my link to tell me if this possible solution will work for me. Its 2012 and people still have issues with .dll files. F***ing ridiculous Microsoft.

  • 11 aprilie 2012 04:12
     
      Are cod

    Hi aj, I had to get some sleep :)

    At this point I can only make a couple of suggestions:

    1. Put a match to your PC. Although you may feel better, it's not gona solve your problem but you could do it.

    2. Go into MS Access and create a form. Put a button on the form. When your in the codebehind go to Tools->References and add a reference to dao360.dll. Then in that button event, create an object like:

    Dim dbe as New DAO.DBEngine


    If that doesn't work then try the next step

    3. Unregister dao360.dll (for the gazillianth time) then take it out of microsoft shared\DAO folder. Put it somewhere safe. Uninstall Office and reinstall office. DAO has always be big part of MS Access so at this point I'm hoping (sad that hope is involved) the office installation will regenerate dao360.dll for you.

    I'm also at wits end aj.

  • 11 aprilie 2012 13:48
     
     

    rupex my good buddy, couple things, goodmorning first of all lol

    Second, I would LOVE to do #1 on your suggestion list, but it is a work computer. I did suggestion #2, then went into vs2010 and dao 3.6 object library was there!:) Thats the good news. The bad, however, is that it is still showing up "The system cannot find the reference specified" in the reference tab after I add the COM object in my vb app.

    However, I created a new project(C#, which is my preferred language) and added the COM object to the project, and it took like a charm.

    But it really bummed me out because that means the issue is within my vb app itself. Which is really unfortunate considering it took the developer OVER 2 years to get the app up and running. I hope someone can enlighten me.

    Also, I cannot uninstall MS Office, due to the fact that when my work computer was ordered(from Dell), they never sent me any installation discs or anything. Just the computer with preinstalled software.

  • 11 aprilie 2012 14:21
     
     

    Hmm, that is interesting behavior. When you created the new project, what framework was it using, 2.0, 3.5, 4.0?

    If you are able to add it to your c# project then, compile the c# project. In the project folder under bin\debug a file will be created call Interop.DAO.dll. Copy this file from your c# project into the project folder of your vb app. Then add a reference to the Interop.DAO.dll file.

  • 11 aprilie 2012 14:54
     
     

    I did that, and to no avail The system cannot find the reference specified:/. This is the error I am getting:

    Error 2: Encountered multiple versions of the assembly with GUID '00020813-0000-0000-c000-000000000046'.  Try pre-importing one of these assemblies.

    This is what I have done: My vb app uses Target Fremwork 2.0. And the new app(C#) I created is using Framework 3.5. Now, I did switch 3.5 to target 2.0, deleted the dao360.dll reference and readded it. It still worked.

    I have called Microsoft and am waiting on a call back about my issue(Could take up to 8 hours to get a call back). I had to elevate the issue due to the fact that this is a time sensitive issue and needs to be fixed asap. I would like to thank everyone who has commented on my issue, and special thanks goes to RUPEX, who stuck it out with me to the end basically lol. I am not giving up but to keep bugging people on here about the issue is not acceptable to me, so hopefully Microsoft can eleviate this mind boggling issue for me.

    I will update this forum when I get the callback to my issue. Hopefully they can get it resolved. Thanks again for helping me out as much as possible!


  • 11 aprilie 2012 14:59
     
     

    I really hope you find a fix. I'm sorry I couldn't help you resolve it but it has become a 'stab in the dark' exercise from my end.

    I will keep my eye out on this post and would like to see the solution if you get one.

    rupex 

  • 30 aprilie 2012 12:49
     
     Răspuns

    So, in the end, I had to use a life line... I called up Microsoft tech support, and luckily didnt get charged for the help, but I got help for the issue. And trust me when I say that Microsoft knows about this issue! Unfortunately they stopped supporting DAO360.dll as this technology is old and outdated. So after about a week of manipulating my projects vb file, and running diagnostic tests with the microsoft engineer, we came to the conclusion to simply take the dll out of my project. All seems fine at the moment as I pushed out an update for the program last Friday but I am still weary on the whole thing.

       And just to be clear, it was flipping hard and frustrating at times to work with someone who barely speaks english lol But nonetheless a good experience. Anywho, all is well so far and the issue seems to be fixed.

      I just hope that whatever the dll exactly did that vs 2010 does it by default or through some other dll.