如何在 64 位机器上以 32 位模式运行 VBScript? [英] How do I run a VBScript in 32-bit mode on a 64-bit machine?

查看:39
本文介绍了如何在 64 位机器上以 32 位模式运行 VBScript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个以 .vbs 结尾的文本文件,我在其中编写了以下内容:

Set Conn = CreateObject("ADODB.Connection")Conn.Provider = "Microsoft.ACE.OLEDB.12.0"Conn.Properties("数据源") = "C:dummy.accdb"Conn.Properties("Jet OLEDB:Database Password") = "pass"连接打开连接关闭设置 Conn = 无

  • 当我在 Windows 32 位机器上执行它时,它会在没有任何想法的情况下运行和结束(预期).
  • 当我在 Windows 64 位机器上执行此操作时,出现错误<块引用>

    找不到提供者.它可能没有正确安装.

但是已经安装了.我认为问题的根源在于提供程序是 32 位提供程序,据我所知它不存在 64 位.

如果我在 64 位机器上通过 IIS 运行 VBScript(作为 ASP 文件),我可以选择它应该在 32 位模式下运行.然后它可以找到提供者.

如何让它在 Windows 64 位上找到提供程序?我可以告诉 CScript(它执行 .vbs 文本文件)以某种方式在 32 位模式下运行吗?

解决方案

follow http://support.microsoft.com/kb/896456

要启动 32 位命令提示符,请执行以下步骤:

* 单击开始,单击运行,键入 %windir%SysWoW64cmd.exe,然后单击确定.

然后输入

cscript vbscriptfile.vbs

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?

解决方案

follow http://support.microsoft.com/kb/896456

To start a 32-bit command prompt, follow these steps:

* Click Start, click Run, type %windir%SysWoW64cmd.exe, and then click OK.

Then type

cscript vbscriptfile.vbs

这篇关于如何在 64 位机器上以 32 位模式运行 VBScript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆