How do I run a VBScript in 32-bit mode on a 64-bit machine?
Posted
by Peter
on Stack Overflow
See other posts from Stack Overflow
or by Peter
Published on 2010-05-10T21:29:40Z
Indexed on
2010/05/10
21:34 UTC
Read the original article
Hit count: 276
I have a text file that ends with .vbs that I have written the following in:
Set Conn = CreateObject("ADODB.Connection")
Conn.Provider = "Microsoft.ACE.OLEDB.12.0"
Conn.Properties("Data Source") = "C:\dummy.accdb"
Conn.Properties("Jet OLEDB:Database Password") = "pass"
Conn.Open
Conn.Close
Set Conn = Nothing
When I execute this on a Windows 32-bit machine it runs and ends without any notion (expected). When I execute this on a Windows 64-bit machine it gets the error "Provider cannot be found. It may not be properly installed.".
But it is installed. I think the root of the problem is that the provider is a 32-bit provider, as far as I know it doesn't exist as 64-bit.
If I run the VBScript through IIS on my 64-bit machine (as a ASP file) I can select that it should run in 32-bit mode. It can then find the provider.
How can I make it find the provider on Windows 64-bit? Can I tell CScript (which executes the .vbs text file) to run in 32-bit mode somehow?
© Stack Overflow or respective owner