ADODB.Connection Automation Error

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ricovox
    New Member
    • Sep 2008
    • 10

    ADODB.Connection Automation Error

    Hello,

    Every time I try to create an ADODB.Connectio n object, I receive the following error:
    -----------
    Runtime Error '-2147024703 (800700c1)':

    Automation error
    %1 is not a valid Win32 Application.
    -------------

    I am running Windows 7 Ultimate (64 bit).
    This IS NOT a connection string problem, nor is it application-specific.

    I can easily reproduce the error in a number of ways:
    (Method 1 VB or VBA Direct Reference)
    Using visual basic 6 IDE OR Microsoft Office VBA IDE, add a reference to Microsoft ActiveX Data Objects (I have tested versions 2.6, 2.7, 2.8, and 6.0). Add a code module with the following code:
    Code:
    Dim oConn As ADODB.Connection
    Set oConn = New ADODB.Connection
    I Run the exe (VB6) or macro (VBA) and get the error described above. Note that I have tried each version of ADO listed above individually, and receive the same error on all versions.

    (Method 2 VB or VBA CreateObject)
    Using visual basic 6 IDE OR Microsoft Office VBA IDE, add a code module with the following code:
    Code:
    Dim oConn As Object
    Set oConn = CreateObject("ADODB.Connection")
    I Run the exe (VB6) or macro (VBA) and get the error described above. (Note that no versions of ADO are added as references.)

    (Method 3 WSH) Create a wsh vbs script with the following code:
    Code:
    dim obj: set obj = wScript.CreateObject("ADODB.Connection")
    (The error message in this case is slightly different, but the number (800700c1) is the same.)

    Clearly, the above 3 methods show that this error is not related to a specific application etc. but is instead a problem with ADO itself or the installation of MDAC/Windows DAC on my machine. Perhaps it is some conflict of ADO with a 64bit machine.

    Can anyone confirm using Windows 7 Ultimate with VB6 professional installed whose ADO IS working?
    Can anyone suggest how I might go about repairing Windows DAC 6.0? I have not found a way to do so in any forum I have checked.

    Thanks for any help and suggestions you can offer!
    Last edited by ricovox; Apr 27 '10, 02:59 PM. Reason: missing bbcode tag
  • laurin1
    New Member
    • Jun 2010
    • 3

    #2
    Did you ever get this figured out? I'm having a similar problem.

    Comment

    • ricovox
      New Member
      • Sep 2008
      • 10

      #3
      Originally posted by laurin1
      Did you ever get this figured out? I'm having a similar problem.
      Sorry, but no. I am still having the problem, and no one has offered suggestions for fixing it. :-(

      Comment

      • laurin1
        New Member
        • Jun 2010
        • 3

        #4
        Well, I did figure mine out, however, I'm running this in AutoIt (scripting engine.) Mine was a call I make do disable the 64 bit redirection for another part of the script. I moved my ADODB call above that and it works great. Since you are on 64 bit as well, I'd bet money that it's a 64 bit problem.

        Comment

        • ricovox
          New Member
          • Sep 2008
          • 10

          #5
          Originally posted by laurin1
          Well, I did figure mine out, however, I'm running this in AutoIt (scripting engine.) Mine was a call I make do disable the 64 bit redirection for another part of the script. I moved my ADODB call above that and it works great. Since you are on 64 bit as well, I'd bet money that it's a 64 bit problem.
          Thanks. Can you tell me a little bit more about what you mean by "disable the 64 bit redirection"? For example, what AutoIt script command does this refer to?
          Thanks,
          Richard

          Comment

          • laurin1
            New Member
            • Jun 2010
            • 3

            #6
            Originally posted by ricovox
            Thanks. Can you tell me a little bit more about what you mean by "disable the 64 bit redirection"? For example, what AutoIt script command does this refer to?
            Thanks,
            Richard
            I doubt the exact problem I had is yours as well, but the problem I had is similar in that redirect being disabled mean that the object creation could not occur, because it could not find the ADODB files.

            The registry key that controls that is here:
            Wow64DisableWow 64FsRedirection

            Do you understand that 64 bit Windows works with 32 bit applications by using WOW (Windows on Windows)? That need it redirects calls to certain parts of the file system and to the Registry coming from 32 bit applications to special folders and registry locations?

            c:\Program Files (x86)
            c:\Windows\SysW ow64
            HKLM\Software\S ysWow64

            Comment

            Working...