简体   繁体   English

在 Windows server 2008 R2 64bit & IIS7.5 上运行经典的 asp & ms access 2000

[英]Running classic asp & ms access 2000 on Windows server 2008 R2 64bit & IIS7.5

I have an old website that is built with classic asp and MS access 2000 and was running fine on an old server.我有一个使用经典 asp 和 MS Access 2000 构建的旧网站,并且在旧服务器上运行良好。 I need it to work on new machine equipped with Windows Server 2008 R2 64bit & IIS7.5我需要它在配备 Windows Server 2008 R2 64 位和 IIS7.5 的新机器上工作

I tested ASP classic and it is running fine on the new machine.我测试了 ASP classic,它在新机器上运行良好。 What I am trying to do is to make connections with the ms access db.我想要做的是与 ms access db 建立连接。

I installed "Microsoft Access Database Engine 2010 Redistributable" 64bit and restarted the machine.我安装了“Microsoft Access Database Engine 2010 Redistributable”64 位并重新启动了机器。

ASP code is something like this: ASP代码是这样的:

<%dim db
set db=server.createobject("adodb.connection")
db.open "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & server.mappath("Staff.mdb")%>

I got the error message: "500 - Internal server error. There is a problem with the resource you are looking for, and it cannot be displayed."我收到错误消息:“500 - 内部服务器错误。您要查找的资源有问题,无法显示。”

Is there some kind of configuration I need to do on IIS or something...我需要在 IIS 或其他什么东西上做某种配置吗?

Driver={Microsoft Access Driver (*.mdb)} is the ODBC driver name for the older "Jet" database engine. Driver={Microsoft Access Driver (*.mdb)}是较旧的“ Jet”数据库引擎的ODBC驱动程序名称。 It ships with Windows, but it is only available to 32-bit applications and it only works with the older .mdb database file format. 它与Windows一起提供,但仅适用于32位应用程序,并且仅适用于较早的.mdb数据库文件格式。

If you need to 如果你需要

  • work with an .mdb database from a 64-bit application, or 通过64位应用程序使用.mdb数据库,或
  • work with an .accdb database from any application 任何应用程序使用.accdb数据库

then you need to have the newer Access Database Engine (aka "ACE") installed, and your driver name needs to be Driver={Microsoft Access Driver (*.mdb, *.accdb)} . 那么您需要安装更新的Access数据库引擎 (又名“ ACE”),并且驱动程序名称必须为Driver={Microsoft Access Driver (*.mdb, *.accdb)}

I used to have to migrate a web system that is asp connected to the mdb database worked on windows server 2003 moved to work on windows server 2008 R2.我曾经不得不迁移一个连接到在 windows server 2003 上工作的 mdb 数据库的 asp 的 web 系统,转移到 windows server 2008 R2 上工作。

encountered the same problem and fix it this way遇到同样的问题并通过这种方式修复它

1.The default setting after the IIS installation is complete will cause the error time to run. 1.IIS安装完成后的默认设置会导致运行时间错误。 The details of the problem will not be displayed on the web browser.问题的详细信息不会显示在网络浏览器上。 Solve the problem by : set IIS to show errors解决方法:设置IIS显示错误

(credit : https://docs.microsoft.com/th-th/iis/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-script-error-messages-no-longer-shown-in-web-browser-by-default ) (信用: https : //docs.microsoft.com/th-th/iis/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/classic-asp-script-error -messages-no-longer-shown-in-web-browser-by-default )

2.The problem encountered is that the database or object is read only. 2.遇到的问题是数据库或者对象是只读的。 Solve the problem by :通过以下方式解决问题:

  • Move the mdb file out of the web folder and not in the web subfolder.将 mdb 文件移出 web 文件夹而不是 web 子文件夹。 (ex : d:\\web_data) (例如:d:\\web_data)

  • At the new folder of mdb, configure full control access to the users group of windows.在mdb新建文件夹,配置windows用户组的完全控制权限。

  • Specify a channel between asp and mdb with this command.使用此命令指定 asp 和 mdb 之间的通道。

    Set Conn = Server.Createobject("ADODB.Connection") Set Conn = Server.Createobject("ADODB.Connection")

    Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=d:\\web_data\\data.mdb" Conn.Open "PROVIDER=MICROSOFT.JET.OLEDB.4.0;DATA SOURCE=d:\\web_data\\data.mdb"

(credit : https://docs.microsoft.com/th-th/iis/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/using-classic-asp-with-microsoft-access-databases-on-iis ) (信用: https : //docs.microsoft.com/th-th/iis/application-frameworks/running-classic-asp-applications-on-iis-7-and-iis-8/using-classic-asp-with -microsoft-access-databases-on-iis )

(credit : https://www.thaicreate.com/asp/asp-ms-access-connect-database.html ) (信用: https : //www.thaicreate.com/asp/asp-ms-access-connect-database.html

hope this is helpful.希望这是有帮助的。 :-) :-)

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

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