我有很多用旧的经典 ASP 编写的项目,其中 Global.asa 曾经工作得很好。由于我安装了带有 IIS7.5 的 Windows 7,所以我的项目都无法运行。
下面是 Global.asa 的代码,
<Script language=vbscript runat = server>
Sub Application_OnStart()
dim objConn, connectionString
set objConn = Server.CreateObject("ADODB.Connection")
connectionString = "DSN=otsDSN; UID=admin;PWD=;"
objConn.ConnectionTimeout = 5
错误出现在这一行。参考了很多网站,甚至IIS.Net,但仍然没有成功。
objConn.Open connectionString
Application("otsAppConn") = objConn
end Sub
IIS 抛出的错误是
错误“80004005”
/ot/admin/page1.asp,第 33 行 和旧版 IIS 系列中用于携带连接对象字符串的应用程序对象现在显示 Provider=MSDASQL.1; 而不是完整的连接字符串。
所有项目都被列为 IIS7.5 中的应用程序,我可以使用 appcmd 列表应用程序 看到它
。如果有人可以提供帮助,我将不胜感激。
I have many projects written in old classic ASP where Global.asa used to work perfectly fine. Since I have installed Windows 7 with IIS7.5, none of my projects are working.
Below is the code for Global.asa
<Script language=vbscript runat = server>
Sub Application_OnStart()
dim objConn, connectionString
set objConn = Server.CreateObject("ADODB.Connection")
connectionString = "DSN=otsDSN; UID=admin;PWD=;"
objConn.ConnectionTimeout = 5
The error comes in this line. Have referred many websites, even IIS.Net but still no luck.
objConn.Open connectionString
Application("otsAppConn") = objConn
end Sub
The error thrown by IIS is
error '80004005'
/ot/admin/page1.asp, line 33 and the Application object which used to carry the connection object string in older family of IIS now showing, Provider=MSDASQL.1; instead of complete connection string.
All the projects are listed as Application in IIS7.5 which I could see using the appcmd list apps
Appreciate if someone can help on this..
发布评论
评论(2)
看看提供的链接中的信息是否可以帮助您获得更好的调试信息。大约中间有一个设置可以打开,当我尝试在 iis 7.5 中运行经典 asp 时,可以打开它来查看错误代码背后的内容 http://learn.iis.net/page.aspx/564/classic-asp-script-error-messages-no-longer-shown-in-web-browser-by-default/。
see if the information in the provided link helps you get some better debug info. About halfway down there is a setting you can turn on that allowed me to see what was behind the error code when I was trying to run a classic asp in iis 7.5 http://learn.iis.net/page.aspx/564/classic-asp-script-error-messages-no-longer-shown-in-web-browser-by-default/.
在 IIS 中进行长时间故障排除后设法解决了该问题。
将 DSN 连接提供程序转换为 Microsoft Access 驱动程序 (.mdb),而不是 Microsoft Access 驱动程序(.mdb、*.accdb)
在我的网站下的 IIS 中的自定义下创建连接字符串
并提供与 DSN 连接相同的连接名称
将 Global.asa 连接字符串从“DSN=”更改为aaa;UID=管理员;PWD=;"只需删除后一部分即可将其更改为“aaa”。
新代码如下所示:
Managed to resolve the issue after long troubleshooting in IIS.
Converted the DSN connection provider to Microsoft Access Driver (.mdb) instead of Microsoft Access Driver (.mdb, *.accdb)
Created Connection String in IIS under my website under Custom
and gave the Connection Name same as the DSN connection
Changed the Global.asa connectionString from "DSN=aaa;UID=admin;PWD=;" to "aaa" only by removing the latter portion.
The new code looks like this: