我有其他人写的旧代码,最近在服务器升级过程中损坏了。
我创建了32位DSN连接和64位DSN连接。
32位的错误如下。
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] The specified DSN contains an architecture mismatch between the Driver and Application
/path/to/connection/file.asp, line 12
出现上述错误的代码是:
<%
dim Conn
Dim powerConn
dim connstr
Dim pconnstr
connstr = Application("databaseA")
pconnstr = Application("databaseB")
Sub openConnection()
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionTimeout = 600
Conn.CommandTimeout = 600
Conn.Open connstr // Error occurs here
Set pConn = Server.CreateObject("ADODB.Connection")
pConn.Open pconnstr
End Su
Sub closeConnection()
Conn.close
set Conn = Nothing
pConn.Close
set pConn = Nothing
End Sub
%>
然后我尝试了64位连接,得到了这个错误:
Microsoft OLE DB Provider for ODBC Drivers error '80004005'
[Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
/path/to/connection/file.asp, line 12
出现上述错误的代码是:
<%
dim Conn
Dim powerConn
dim connstr
Dim pconnstr
connstr = Application("databaseA_64bit")
pconnstr = Application("databaseB_64bit")
Sub openConnection()
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.ConnectionTimeout = 600
Conn.CommandTimeout = 600
Conn.Open connstr // Error occurs here
Set pConn = Server.CreateObject("ADODB.Connection")
pConn.Open pconnstr
End Su
Sub closeConnection()
Conn.close
set Conn = Nothing
pConn.Close
set pConn = Nothing
End Sub
%>
我需要帮助解决这个问题,所以任何评论都非常感谢。