开发者

The microsoft jet database cannot open the file '...' It is already opened exclusively by another user or you need permission to view its data

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.

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 gav开发者_如何学编程e everyone full permissions to the share. Then on the workstation I installed the application and gave the path to the database as follows:

\\myserver\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?

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.


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:

http://walkinghumble.wordpress.com/2009/02/20/cannot-connect-to-an-access-mdb-file-located-on-the-network-through-oledb/

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.


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.

Other important references for making this work are:

"Microsoft ADO Data Control 6.0 (OLEDB)" COM reference

"Microsoft Access 14.0 Object Library" COM reference


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).


Try running these things down...

  1. Are these computers on a domain? If so is the Win 7 box joined to the domain?
  2. 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.
  3. 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).
  4. 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.
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜