【发布时间】:2013-04-11 15:51:47
【问题描述】:
我正在尝试使用 asp-classic 将数据库连接到我的网页。我之前使用 .mdb 文件时是成功的,但现在我有一个新的数据库,其格式为 accdb 并且需要是因为 .mdb 文件中不支持的功能。
我用于 .mdb 连接的代码完美运行。
<%@Language=VBScript %>
<%
Dim adoCon
Dim rsLogbook
Dim strSQL
Set adoCon = Server.CreateObject("ADODB.Connection")
adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("DatabaseName.mdb")
Set rsLogbook = Server.CreateObject("ADODB.Recordset")
strSQL = "SELECT TableName.FieldName FROM TableName;"
rsLogbook.Open strSQL, adoCon
Response.Write ("<br>")
Response.Write (rsLogbook("FieldName"))
rsLogbook.Close
Set rsLogbook = Nothing
Set adoCon = Nothing
%>
我尝试用“accdb”替换“.mdb”,但没有成功。任何帮助表示赞赏:)
【问题讨论】:
标签: database ms-access asp-classic