简体   繁体   中英

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. 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:

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? Windows server 2012 only runs over 64 bits machines and there is not version of 64 bits for Microsoft.Jet.OLEDB.4.0.

It seems ASP application can't create the object Conn due to the Provider in connection string:

"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:

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

2) Change the connection string to something like this: 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

First, enable 32 bit compatibility via IIS manager. (It's disabled by default)

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. Right click on the file and select the security tab to check

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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