简体   繁体   English

将经典ASP站点移至新服务器,现在在Conn.Execute中返回“ VBScript运行时错误'800a01a8'对象必需”

[英]Moved a Classic ASP site to a new server, now “VBScript runtime error '800a01a8' Object required” returned on Conn.Execute

I have a classic ASP site connecting to an Access database. 我有一个经典的ASP网站连接到Access数据库。 Recently it's been moved from AT&T web hosting to a dedicated Cloud Server running Windows Server 2012. When the site hit's a line of code to query the database it returns an error: 最近,它已从AT&T虚拟主机移至运行Windows Server 2012的专用Cloud Server。当站点命中一行代码以查询数据库时,它将返回错误:

Microsoft VBScript runtime  error '800a01a8' 

Object required 

/menu.asp, line 145 

The connection is happening in a different file and looks like: 连接发生在另一个文件中,如下所示:

<%
Set Conn = Server.CreateObject("Adodb.Connection")
Dim conStr
Conn.Open = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/data/CNCmachinery.mdb")
%>

The line that throws the error is: 引发错误的行是:

Set RP=Conn.Execute(msql) 'msql contains a basic query

Again, this site was working before the move to a new server, so I'm wondering if it's a compatibility issue? 同样,此站点在移至新服务器之前仍在运行,因此我想知道这是否是兼容性问题? What should I be looking in to? 我应该看什么?

Was your old server a 32 or 64 bits machine? 您的旧服务器是32位还是64位计算机? Windows server 2012 only runs over 64 bits machines and there is not version of 64 bits for Microsoft.Jet.OLEDB.4.0. Windows Server 2012仅在64位计算机上运行,​​并且Microsoft.Jet.OLEDB.4.0没有64位版本。

It seems ASP application can't create the object Conn due to the Provider in connection string: 似乎由于连接字符串中的提供者,ASP应用程序无法创建对象Conn:

"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("/data/CNCmachinery.mdb")

If you old server was a 32 bits or a 64 bits but a version of 32 bits of Office installed, try this please: 如果您的旧服务器是32位或64位,但是安装了32位版本的Office,请尝试以下操作:

1) Installing in your windows server 2012 the Office System Driver: Data Connectivity Components: Office 2007 version or Office 2010 version (Depending your version of Office installed in Windows Server 2012 1)在Windows Server 2012中安装Office System驱动程序:数据连接组件: Office 2007版本Office 2010版本 (取决于Windows Server 2012中安装的Office版本)

2) Change the connection string to something like this: Conn.Open = "Provider=Microsoft.ACE.OLEDB.12.0;Data Source=" & Server.MapPath("/data/CNCmachinery.mdb") 2)将连接字符串更改为如下所示:Conn.Open =“ Provider = Microsoft.ACE.OLEDB.12.0; Data Source =”&Server.MapPath(“ / data / CNCmachinery.mdb”)

Assuming that you have moved from a 32 bit to a 64 bit server, which is very likely, there are two things you can try 假设您已经很可能从32位服务器迁移到64位服务器,则可以尝试两种方法

First, enable 32 bit compatibility via IIS manager. 首先,通过IIS管理器启用32位兼容性。 (It's disabled by default) (默认情况下处于禁用状态)

https://help.webcontrolcenter.com/KB/a1114/how-to-enable-32-bit-application-pool-iis-7-dedicatedvps.aspx https://help.webcontrolcenter.com/KB/a1114/how-to-enable-32-bit-application-pool-iis-7-dedicatedvps.aspx

Second, does the IUSR account associated with your website have read/write permission on your mdb file. 其次,与您的网站关联的IUSR帐户是否对您的mdb文件具有读/写权限。 Right click on the file and select the security tab to check 右键单击该文件,然后选择“安全性”选项卡以进行检查

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM