已由另一个用户独占打开的Access数据库 [英] Access Database already exclusively opened by another user

查看:219
本文介绍了已由另一个用户独占打开的Access数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个位于服务器x上的访问数据库iis正在服务器y上运行.我的网页之一从访问数据库访问数据.如果有人打开了访问数据库,请说我们网络上的最终用户,则该网页将失败,而...已经由另一个用户错误消息专门打开了.

I have an access database that sits on server x iis is running on server y. One of my web pages access data from the access database. If someone has the access database open say a end user on our network the web pages fail with a ...already opened exclusively by another user error message.

我创建了一个本地访问数据库并使用了链接表,以便以这种方式访问​​表.甚至我仍然得到已经由另一个用户独占打开的错误.如果我通过Windows资源管理器浏览到服务器x并打开数据库,我可以毫无问题.所以我的问题是,如何模拟与数据库的相同类型的连接而不会引发错误,这是访问数据库的权限问题或连接字符串中允许我访问数据库的内容的问题.

I created a local access database and used linked tables in order to access the tables that way. Even still I get the already opened exclusively by another user error. If I go through windows explorer and browse out to server x and open the database I can without issue. So my question is how can I simulate the same type of connectivity to the database without the error being thrown is it a matter of permissions to the access database or something within my connectionstring that would allow me to access the database.

由于它在我的connection.open命令期间引发错误,因此我想它与权限相关,或者我需要添加到连接字符串中的其他东西.我已经完全控制了访问数据库的本地实例所在的本地目录上的IIS AppPool \,但似乎没有任何作用.

Since it throws the error during my connection.open command I am figuring it is either permission related or something additional I need to add to my connection string. I have granted full control for the IIS AppPool\ on the local directory in which my local instance of the access database resides in but didn't seem to make a difference.

我的连接字符串如下:

Private Shared connSheriff As New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\\serverx\directory\Access\MyDatabase.mdb;Jet OLEDB:Database Password=property;")

推荐答案

有些

There are some options within the mdb that change how the database is opened by default, these should be your first port of call particularly setting the "default open mode" to "shared".

您已经拆分了数据库(共享后端中的数据表,链接表以及前端中的其余表).确保每个用户使用单独的前端mdb副本,否则您将在此问题上遇到锁定问题.

You've already split the database (data tables in the shared back-end, linked tables and the rest in the front-end). Make sure that each user uses a separate copy of the front-end mdb, otherwise you'll get locking issues on this.

有一个命令行开关(/excl)设置了独占模式,但是您只是忽略了此选项以打开共享的数据库,所以我怀疑这是一个问题.

There is a command line switch (/excl) that sets exclusive mode, but you just omit this to open the db shared so I doubt this is a problem.

您可能已经知道这一点,但是"共享"修饰符与应用程序或用户之间的共享无关,但共享类实例之间的连接变量(C#等效为静态")

You probably already know this but the "Shared" modifier has nothing to do with sharing between applications or users, but shares the connection variable between instances of your class (the c# equivalent is "static")

这篇关于已由另一个用户独占打开的Access数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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