Results 1 to 5 of 5
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    NJ, USA
    Posts
    239
    Thanks
    2
    Thanked 1 Time in 1 Post

    ADO connection (Excel 2003)

    In an Excel workbook I have standard code to connect to a SQL Server database using ADO. It works fine for all users but one.
    On her computer, when it tries to execute the <pre> cnConnect.Open</pre>

    line, it immediately errors out. The error description is "Error in the DLL" (error number: -2147220999).
    Her Tools > References are identical to everybody else's, and I tried reinstalling MDAC but that made no difference. I was assuming that the DLL in the error message was referring to the ADO library (actually a TLB file - msado27.tlb).
    At this point I'm stumped. Anybody have any ideas as to how to proceed? I'm wondering if there's another system file on her computer that is either corrupted or is incompatible maybe.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ADO connection (Excel 2003)

    1) Does it work if you set a reference to Microsoft ActiveX Data Objects 2.1 or 2.8 instead?

    2) Does it help if you re-register MSADO:
    - Select Start | Run..
    - Type <code>regsvr32 C:Program FilesCommon FilesSystemADOmsado27.tlb</code>
    - Press Enter or click OK.

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: ADO connection (Excel 2003)

    I always set the reference to the library that corresponds to msado15.dll as Microsoft seems to keep that file updated for purposes of backwards compatibility. Not sure whether that will help you or not!

  4. #4
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    NJ, USA
    Posts
    239
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: ADO connection (Excel 2003)

    Thanks to you (and Hans) for your responses. The user *does* have a copy of msado15.dll installed and that gives the same error. BTW, the full text of Err.Description is "Automation Error. Error in the DLL". I tried referencing older libraries (e.g., 2.1 that Hans mentioned), but still get the same error. I also tried Hans' suggestion of explicitly registering the DLL but that didn't help either.
    All I can think of is to ask her to reinstall Office (or just Excel(?)). Do you think that might fix it?
    Thanks again.

  5. #5
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: ADO connection (Excel 2003)

    It's unlikely that the error is in Excel or Office, I still suspect MDAC. I'd download and install the MDAC Component Checker (Genuine Windows validation required), to see if you find problems.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •