windows microsoft jet 数据库无法打开文件 '...' 它已被其他用户以独占方式打开,或者您需要查看其数据的权限
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/7275410/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
The microsoft jet database cannot open the file '...' It is already opened exclusively by another user or you need permission to view its data
提问by BruceHill
I have a WinForms application that I have taken over support for and it was build using Visual Studio 2005 with VB.Net. The application makes use of an Access database. It runs fine when it is installed as a standalone application, but the install cd for the application also allows for a network install and this is where I am currently encountering issues.
我有一个 WinForms 应用程序,我已经接管了它的支持,它是使用 Visual Studio 2005 和 VB.Net 构建的。该应用程序使用 Access 数据库。当它作为独立应用程序安装时它运行良好,但应用程序的安装 cd 也允许网络安装,这是我目前遇到的问题。
To test the network install I created a folder on my server (Windows Server 2003 SP2) and copied the Access database to this folder. I created a share for this folder and gave everyone full permissions to the share. Then on the workstation I installed the application and gave the path to the database as follows:
为了测试网络安装,我在我的服务器 (Windows Server 2003 SP2) 上创建了一个文件夹并将 Access 数据库复制到该文件夹中。我为此文件夹创建了一个共享,并授予每个人对该共享的完全权限。然后在工作站上我安装了应用程序并给出了数据库的路径如下:
\\myserver\myshare\mydb.mdb
\\我的服务器\myshare\mydb.mdb
(The install steps here are as per the instructions given on the installation cd)
(这里的安装步骤按照安装光盘上的说明进行)
The workstation that I installed it on is Windows 7 Ultimate. When I run the application, I get the error message given in the title when the application tries to read the database file. I have confirmed that I am able to write to the shared folder on the server, so I don't think this is a permissions issue. Also, the database file is not in use at all, so it is definitely not opened exclusively. Anyone have any idea what could be causing this and what I could try do to get it working?
我安装它的工作站是 Windows 7 Ultimate。当我运行应用程序时,当应用程序尝试读取数据库文件时,我收到标题中给出的错误消息。我已经确认我可以写入服务器上的共享文件夹,所以我认为这不是权限问题。另外,数据库文件根本没有使用,所以肯定不是独占打开的。任何人都知道可能导致这种情况的原因以及我可以尝试做些什么来使其正常工作?
UPDATE:
更新:
I have tested the workstation installation on a computer with a fresh install of Windows XP SP3 and it is able to access the database file without a problem. So it seems that this error that I am getting is somehow specific to Windows 7. Is there maybe a known issue with Oledb drivers on Windows 7? My version of Windows 7, btw is 32 bit.
我已经在一台全新安装了 Windows XP SP3 的计算机上测试了工作站安装,它能够毫无问题地访问数据库文件。因此,我遇到的这个错误似乎是 Windows 7 特有的。Windows 7 上的 Oledb 驱动程序可能存在已知问题吗?我的 Windows 7 版本,顺便说一句是 32 位。
回答by Mircea Ion
There could be so many things so it is hard to give a precise answer. However, I had a similar problem a while a go and I wrote a post which I don't want to duplicate here:
可能有很多事情,所以很难给出一个准确的答案。但是,我有一段时间遇到了类似的问题,我写了一篇我不想在这里复制的帖子:
Maybe it will help if the underlying problem is the same (even though in my case it was an ASP.NET app). If not it will at least promote the process monitor if you did not know it yet.
如果潜在问题相同,也许会有所帮助(即使在我的情况下它是一个 ASP.NET 应用程序)。如果不是,它至少会在您还不知道的情况下提升进程监视器。
回答by Mircea Ion
Jet 4.0 won't be able to open an Access file without the "Microsoft ADO Ext 2.8 for DDL and Security" COM reference set in the project's reference settings. To check status of references go: Project-->References-->COM.
如果没有在项目的参考设置中设置“Microsoft ADO Ext 2.8 for DDL and Security”COM 参考,Jet 4.0 将无法打开 Access 文件。要检查引用的状态,请转到:Project-->References-->COM。
Other important references for making this work are:
进行这项工作的其他重要参考资料是:
"Microsoft ADO Data Control 6.0 (OLEDB)" COM reference
“Microsoft ADO 数据控件 6.0 (OLEDB)”COM 参考
"Microsoft Access 14.0 Object Library" COM reference
“Microsoft Access 14.0 对象库”COM 参考
回答by Barry Gilbert
Sometimes Access reports this error when you have an undisposed MS Access process on your own machine. Check Task Manager's processes list (not applications).
有时,当您自己的计算机上有未处理的 MS Access 进程时,Access 会报告此错误。检查任务管理器的进程列表(不是应用程序)。
回答by Matthew Ferry
Try running these things down...
尝试运行这些东西......
- Are these computers on a domain? If so is the Win 7 box joined to the domain?
- Did you set the permissions while being logged on at the server - or did you set the permissions from a share on another machine? Set the permissions on the server itself.
- From the Win 7 box - verify that you can open the share on the 2003 server, and change the access file name (just as a test - change it back of course).
- Do you have Access installed on the win 7 box? If so - see if you can access the share and use access to open the .mdb.
- 这些计算机是否在域中?如果是这样,Win 7 盒子是否已加入域?
- 您是否在登录服务器时设置了权限 - 或者您是否从另一台计算机上的共享设置了权限?设置服务器本身的权限。
- 从 Win 7 框中 - 验证您可以在 2003 服务器上打开共享,并更改访问文件名(作为测试 - 当然可以改回来)。
- 你在 win 7 box 上安装了 Access 吗?如果是这样 - 看看您是否可以访问共享并使用访问权限打开 .mdb。