通过网络共享的 MS Access 数据库

发布于 2024-08-11 06:50:28 字数 534 浏览 1 评论 0原文

我有一个简单的网站,需要通过 unc 共享连接到 access 数据库。

服务器是运行 IIS 6 的 Windows 2003 机器。通过 ODBC 连接。

我们收到一条错误消息,内容为“
错误 [42000] [Microsoft][ODBC Microsoft Access 驱动程序] 密码无效。
错误 [IM006] [Microsoft][ODBC Driver Manager] 驱动程序的 SQLSetConnectAttr 失败

我猜测 IIS 服务器无权访问共享。应用程序池在网络服务下运行。

我该如何解决这个问题?

更新
这变得很奇怪。如果我在 ODBC 配置中检查了只读并且没有其他人附加到该数据库,那么它就可以工作。

如果其他人附加到它,则会出现错误“HY000][Microsoft][ODBC Microsoft Access Driver]不能使用“(未知)”;文件已在使用中。”

如果我取消选中只读配置(没有其他更改),则会显示“不是有效的密码”。

I have a simple web site that needs to connect to an access database over a unc share.

The server is a windows 2003 box running IIS 6. The connection is via ODBC.

We're receiving an error message that says "
ERROR [42000] [Microsoft][ODBC Microsoft Access Driver] Not a valid password.
ERROR [IM006] [Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttr failed

I'm guessing that the IIS server doesn't have access to the share. The app pool is running under Network Service.

How can I fix this?

UPDATE
This just got weird. IF I have ReadOnly checked in the ODBC configuration AND No one else is attached to that database, then it works.

If someone else attaches to it then it gives me an error "HY000][Microsoft][ODBC Microsoft Access Driver] COuld not use '(unknown)'; file already in use."

If I uncheck the readonly configuration (no other changes), then it says "Not a valid password".

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

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

发布评论

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

评论(3

蝶舞 2024-08-18 06:50:28

如果我在 ODBC 配置中检查了只读并且没有其他人附加到该数据库,那么它就可以工作

可以工作,这表明您具有对共享的读取访问权限,但没有写入访问权限。

IF I have ReadOnly checked in the ODBC configuration AND No one else is attached to that database, then it works

That would suggest that you have read access to the share, but not write access.

忆梦 2024-08-18 06:50:28

这是一个非常常见的问题。 一种方法是在有权访问该共享的域用户下运行应用程序池,或者让您的 Web 应用程序模拟有权访问该共享的域用户:

解决此问题的 com/kb/207671" rel="nofollow noreferrer">如何从 IIS 应用程序访问网络文件

This is a very common problem. One way of fixing this is to run your application pool under domain user that has access to that share, or have you web application impersonate a domain user that has access to the share:

How to access network files from IIS applications

微暖i 2024-08-18 06:50:28

我没有这方面的经验(我不认为 Jet/ACE 是适合网站的数据存储),但我对 Jet/ACE 了解很多。

事实上,当您设置为“只读”时,您会获得连接,这表明正在运行 Web 服务器的用户缺乏对您正在打开的文件的写入权限(或者更可能的是,对于它所在的文件夹和/或共享)这使得它可以通过网络使用)。来自单个用户的只读连接不需要创建 LDB 文件(记录锁定文件)。如果 Web 服务器用户对存储 MDB/ACCDB 的文件夹没有 CHANGE 权限,则将无法创建 LDB 文件,因此无法编辑该文件。

另外,请记住,Jet/ACE 的所有操作都使用用户名。显然,它将使用没有密码的默认管理员帐户,但也许您尝试提供其他一些用户名/密码对。在这种情况下,可能是您使用了错误的工作组文件,或者使用了与您认为合适的不同的工作组文件。

This is not something I have experience with (I don't consider Jet/ACE to be an appropriate data store for a website), but I know a lot about Jet/ACE.

The fact that when you set to Read-only you get a connection suggests that the user the web server is running as lacks write permission on the file you're opening (or, more likely, for the folder it's in and/or the share that makes it available over the network). A read-only connection from a single user won't need to create an LDB file (the record-locking file). If the web server user doesn't have CHANGE permission on the folder the MDB/ACCDB is stored in, it won't be able to create the LDB file, and thus won't be able to edit the file.

Also, keep in mind that all operations with Jet/ACE utilize a username. Transparently it will use the default admin account with no password, but maybe you've attempted to provide some other username/password pair. In that case, it could be that you're using the wrong workgroup file, or a different one than you assume is appropriate.

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