I am writing this one as part two of my post:
How to Connect to Access Database with VBScript
As part of building the above example, I kept experiencing this error. I found out that 64 bit Windows 7 and Windows Vista don’t have the ability to run VBA in 64 bit. You have to force it to use the 32 bit driver.
Error: Provider cannot be found. It may not be properly installed.
Code: 800A0E7A
Source: ADODB.Connection
There are a couple of workarounds you can employ to make your script work:
Via Command Line
- Hold your windows key and press “R” to open the command prompt
- type: “%windir%\SysWoW64\wscript.exe <vbscript path and filename>”
- Press OK
Via Shortcut
- Create a new shortcut
- For the path type: “%windir%\SysWoW64\wscript.exe <vbscript path and filename> “
- Press OK
Conclusion
Either way, you need to type: “%windir%\SysWoW64\wscript.exe” before your filename to force windows to open your script with the 32 bit driver.
Please comment with any questions, improvements or suggestions. Happy Coding!
Chetan Tammala says
Hi Ryan,
I had observed the same issue today and I could find the root cause from your blog. Thanks a lot for documenting this.
Thanks,
Chetan
Tony says
Thanks Chetan and Ryan. I am able to register the DLL; and I can run a vbscript on the 64-bit PC using the cscript command. My problem is getting an embedded subroutine inside a form written with vbscript to connect back to Oracle and retrieve data. I realize to get any of this to work, you need to make the PC think it is 32-bit mode, Thus, the cscript.exe. But how can this be done with embedded vbscript in a form. That’s the real problem here.
Ryan McCormick says
That makes sense, I get what you are trying to do. Are you running the form in Internet Explorer? If not I suggest trying that first. If you are already running it in Internet Explorer, I suggest researching the Oracle runtime and making sure Internet Explorer is loading the correct one (or loading it period). Another suggestion is to look into creating a .hta file out of it. Here is some info on the .hta https://technet.microsoft.com/en-us/library/ee692768.aspx
Please post back when you figure it out. This sounds like a tricky one.
Tony says
Ryan,
Thanks for the link to the HTA tutorial.
Tony Santaniello says
I have vbscript as part of a form for a client piece of software running on Win7 64bit. Worked fine on 32bit. Most of the data interactions are done with the SQL Server database, but I also need to connect to my Oracle database to get information. When I try to connect using the connection string “Provider=OraOLEDB.Oracle;Data Source=Biodex;User ID=xxxxx;Password=xxxx;” I get the error message you show above. I get the test script to work fine using the cscript, but how can I get the connection to work if it is embedded with other code? Thanks in advance for your help. Tony.
Ryan McCormick says
Sounds like it could be something with the way the Oracle runtime is installed. I found this: https://community.oracle.com/thread/2367179 might be worth a look. Please post back if that helps.
Iain Brown says
Hi,
I can’t get this to work at all, it’s so frustrating! I’m using Office 365 Pro Plus 32bit on Windows 7 64bit and am trying to run vbscript to connect to a test database I’ve setup. I’ve followed the instructions to the letter but am still getting the same error message that you describe.
Dim connStr, objConn, getNames
connStr = “Provider=Microsoft.ACE.OLEDB.12.0;Data Source=C:DashboardTest.accdb;”
Set objConn = CreateObject(“ADODB.Connection”)
objConn.open connStr
it’s falling over at line 4, I have re-registered the ado dll’s, installed access database engines… still can’t get the damn thing to work.
Any ideas, please!?!
Iain Brown says
I’ve solved it… not sure why though. I installed the 64bit version of the Access 2010 Engine and then the ADODB provider appeared in my list of providers and I was able to use it… I thought I needed the 32bit provider though and yes I was using the 32bit version of wscript.exe
Ryan McCormick says
Happy to hear that you figured it out. Please add a comment if you run into more issues.
Pablo Nieto says
Thanks a lot for your post. It solved my problem. I was critical for my company.
sumit says
please provide screenprint of this solution method
Rabab says
thanks, this solved my problem too
Giang T Doan says
Thank you!! This solved the issue that I was having.
Michael Beck says
You’re a genius. Thanks.