从经典ASP连接到MS Access数据库
我正在尝试从经典ASP脚本连接MS Access数据库.
I am trying to connect a MS Access database from classic ASP script.
我正在使用运行IIS7的64位Windows 7操作系统
I am using 64bit Windows 7 OS running IIS7
我有以下一段代码:
Dim Connection
Set Connection = Server.CreateObject("ADODB.Connection")
Response.Write("object created...")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("D://Somnath//ExtraLogistics//Source//ZipDB.mdb") & ";"
Response.Write("connected...")
但是在IIS上运行应用程序时,在浏览器中出现此错误The website cannot display the page
.
but I am getting this error The website cannot display the page
in browser while running application on IIS.
请帮助我从IIS连接到Access数据库.
Please help me to connect to the Access database from my IIS.
您的MapPath看起来不正确.
Your MapPath does not look correct.
看看这个 ASP参考.
Server.MapPath指向虚拟引用的物理位置:
Server.MapPath points to the Physical location of a virtual reference:
例如:
'根目录的物理路径
Response.Write Server.MapPath("/")
For Example:
'Physical path of the root directory
Response.Write Server.MapPath("/")
'DataDirectory的物理路径
Response.Write Server.MapPath("/DataDirectory/")
'Physical path of DataDirectory
Response.Write Server.MapPath("/DataDirectory/")
将 ZipDB.mdb 放置在网站的根目录中,并更改 Server.MapPath("/")
Place the ZipDB.mdb in the root of your website and change the Server.MapPath("/")