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
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?
follow http://support.microsoft.com/kb/896456
To start a 32-bit command prompt, follow these steps:
* Click Start, click Run, type %windir%\SysWoW64\cmd.exe, and then click OK.
Then type
cscript vbscriptfile.vbs