从经典ASP连接到MS Access数据库 [英] Connect to MS Access database from classic ASP

查看:69
本文介绍了从经典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("/")

这篇关于从经典ASP连接到MS Access数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆