通过 ASP.net 使用 ODBC 连接到 Access 数据库

发布于 2024-08-22 03:58:39 字数 770 浏览 1 评论 0原文

我正在尝试使用 Asp.net 应用程序设置与 MS Access 的 ODBC 连接。 我不断收到此错误消息:

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The Microsoft Office Access database engine cannot open or write to the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view and write its data. 
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed 
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The Microsoft Office Access database engine cannot open or write to the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view and write its data

我知道这可能与权限有关,因为它在本地应用程序(控制台应用程序)中工作正常。

已经尝试授予“IUsr_my-machine”读\写权限,但仍然无法解决问题

tks

I'm trying to set an ODBC connection to a MS Access, with an Asp.net app.
I keep getting this error message:

ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The Microsoft Office Access database engine cannot open or write to the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view and write its data. 
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed 
ERROR [HY000] [Microsoft][ODBC Microsoft Access Driver] The Microsoft Office Access database engine cannot open or write to the file '(unknown)'. It is already opened exclusively by another user, or you need permission to view and write its data

I understand that maybe this has something to do with permissions because it works fine in a local app(console application).

already tryed to give read\write permission to 'IUsr_my-machine' but it still doesn't solve the problem

tks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

花心好男孩 2024-08-29 03:58:39

这不是权限。数据库实际上是在 MS Access 中的某处打开的。使用 MS Access 本身打开 Access 数据库与从其他程序连接到它不同。当您使用数据库时,MS Access 将锁定该数据库。你需要找到谁在 MS Access 中打开了它,然后狠狠地打他们,直到他们关闭 Access 程序。

完成此操作后,请向我的办公室报告,以便我可以亲自击败您选择 Access 作为 Web 数据库。这是一件非常愚蠢的事情,因为 Access 是一个进程内或桌面类引擎。网站确实需要像 sql server express 这样的服务器级引擎,可以更好地处理并发用户。

It's not permissions. It's that the database is actually opened in MS Access somewhere. Opening an access database with the MS Access itself is different than connecting to it from another program. MS Access will lock the db while you work on it. You need to find who has it opened in MS Access and beat them over the head until they close the Access program.

After you do that, report to my office so I can beat you myself for choosing Access as a web database. That's a really dumb thing to do, because Access is an in-process or desktop class engine. Web sites really need a server-class engine like sql server express that can do a better job handling concurrent users.

你又不是我 2024-08-29 03:58:39

对于那些因同样的错误而崩溃的人。尝试将 MDB 文件放在您的域文件夹下,然后创建 DSN。这解决了我的问题。

更新:如果您使用数据源,请确保未选中“exclsive”
DSN 屏幕截图

For those who crash here with the same error. Try to put the MDB file under your domain folder and then create DSN. This resolved my issue.

UPDATE: If you are using datasource, make sure that "exclsive" is unchecked
DSN screenshot

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文