使用 asp-classic 连接 accdb 数据库 [英] Connect accdb database using asp-classic

查看:13
本文介绍了使用 asp-classic 连接 accdb 数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 asp-classic 将数据库连接到我的网页.我之前使用 .mdb 文件时成功了,但现在我有一个新的数据库,格式为 accdb 并且需要是因为 .mdb 文件中不支持的功能.

Im trying to connect a database to my webpage using asp-classic. I was successful before when i was using a .mdb file but now i have a new database that is in the format of accdb and needs to be because of a feature that is not supported in the .mdb file.

我用于 .mdb 连接的代码完美运行.

The code i used for the .mdb connection that worked perfectly.

<%@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",但没有成功.任何帮助表示赞赏:)

I tried replacing the ".mdb" with "accdb" but no luck. Any help is appreciated :)

推荐答案

ConnectionStrings.com 通常是一个寻找正确的数据库连接语法时,这是一个很好的起点.

ConnectionStrings.com is usually a pretty good place to start when looking for the right syntax for a database connection.

您在哪里将.mdb"更改为.accdb"?您是否执行了以下操作?

Where did you change ".mdb" to ".accdb"? Did you do the following?

adoCon.Open "DRIVER={Microsoft Access Driver (*.mdb, *.accdb)}; DBQ=" & Server.MapPath("DatabaseName.accdb")

查看错误后(Microsoft OLE DB Provider for ODBC Drivers error '80004005'")似乎这篇知识库文章可以解释问题和解决方法:http://support.microsoft.com/kb/926939

After viewing the error ("Microsoft OLE DB Provider for ODBC Drivers error '80004005'") it seems like this KB Article might explain the issue and workaround: http://support.microsoft.com/kb/926939

这篇关于使用 asp-classic 连接 accdb 数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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