ADODB.Connection Automation ErrorP: 10
ricovoxHello,
Every time I try to create an ADODB.Connection 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:
Expand|Select|Wrap|Line Numbers
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:
Expand|Select|Wrap|Line Numbers
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:
Expand|Select|Wrap|Line Numbers
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!
Apr 27 '10 #
1Post ReplyShare this Question
5 Replies
P: 3
laurin1Did you ever get this figured out? I'm having a similar problem.
Jun 21 '10 #
2replyP: 10
ricovox@laurin1Sorry, but no. I am still having the problem, and no one has offered suggestions for fixing it. :-(
Jun 21 '10 #
3replyP: 3
laurin1Well, 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.
Jun 21 '10 #
4replyP: 10
ricovox@laurin1Thanks. 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
Jun 21 '10 #
5replyP: 3
laurin1@ricovoxI 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:
Wow64DisableWow64FsRedirection
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\SysWow64
HKLM\Software\SysWow64
Jun 21 '10 #
6