如何使1用户对数据库进行更新,让别人只读在Microsoft Access? [英] How to enable 1 user to update the database while allowing others to only read in Microsoft Access?

查看:615
本文介绍了如何使1用户对数据库进行更新,让别人只读在Microsoft Access?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算把我的表单和数据库Microsoft Access应用程序到一个共享驱动器周边的10+的人使用。然而,存在的并发问题。有什么办法来设置,如允许Microsoft Access数据库进行更新,只有1人在任何一个时间,让别人看它,但不能更新呢?现在,Access数据库只能更新由一个人阅读,而其他人甚至无法打开该文件。非常感谢提供的任何帮助!

解决方案
  

我想要做的就是只允许1人能够对数据库进行更新,而其他人将只读什么。

是的,这是可以做到的,你不需要更改应用程序code做到这一点。它可以通过调整上的共享文件夹和共享文件的权限来实现。

上的文件夹权限

当一个或多个用户需要读/写访问的ACE / Jet数据库文件(.ACCDB或.mdb)中,所有用户必须有创建文件/写数据文件夹在该文件所在的权限。这是因为Jet数据库引擎中的副本需要能够创建锁定文件(.laccdb或.LDB),如果他们是第一个人到数据库。

请注意是谁只会拥有只读即使用户访问的文件的还是需要创建文件的权限上的文件夹的。这是必要的。

上的文件权限(.ACCDB或.mdb)中

这是你区分用户谁可以更新的数据库,与用户之间只进行只读访问。只需使用的文件在Windows权限,以给他们读+写,或根据需要只读权限。

常见错误#1:设置用户/组权限(读写或只读)的文件夹,并让数据库文件(.ACCDB或.mdb)中继承其

在这种情况下,读+写的用户可以创建锁文件,但只读的用户则不能。

&公牛;方案A:如果读+写的用户首先打开数据库,然后锁定文件被创建和一切工作按预期。更多读+写的用户可以打开数据库,并进行更新,和额外的只读的用户只读方式打开数据库。

&公牛;方案B:如果一个只读的用户第一次打开数据库文件,然后访问他们的副本打开该文件为只读,符合市场预期。但是,如果读+写的用户(根据其文件的权限),然后尝试打开该数据库文件,他们将打开它只读了。每个人都可以得到的,但没有人可以做出改变。

常见错误#2:禁止为大家在文件夹上创建文件

在这种情况下,任何人都不能创建锁文件,使每个人都打开数据库的只读,不论其对数据库文件本身。权限

补充说明:

以上结果证实与Access_2010和Access_2013客户的混合连接到共享.ACCDB后端的Windows Server 2012上在早期版本的Access,如果没人能,在创建锁文件,然后第一人将打开独占模式的数据库文件,并得到任何访问他们的文件权限允许的,而所有后来的用户会被拒绝,并显示错误消息,访问指出的的文件已经以独占方式打开另一个用户。

I am planning to put my microsoft access application with forms and database onto a shared drive for around 10+ people to use. However, there is the issue of concurrency. Is there any way to set it such as to allow the microsoft access database to be only updated by 1 person at any one time while allowing others to read it but not update it? For now, the access database can only be updated and read by a single person while the others cannot even open the file. Thanks a lot for any help rendered!

解决方案

What i want to do is allowing only 1 person to be able to update the database while others will read-only.

Yes, it can be done, and you don't need to change your application code to do it. It can be accomplished by adjusting the permissions on the shared folder and the shared file.

Permissions on the Folder

Whenever one or more users need read/write access to an ACE/Jet database file (.accdb or .mdb), all users must have Create files / write data permission on the folder in which the file resides. This is because their copy of the Access Database Engine needs to be able to create the lock file (.laccdb or .ldb) if they are the first person into the database.

Note that even users who will just have read-only access to the file still need "Create files" permission on the folder. This is essential.

Permissions on the File (.accdb or .mdb)

This is where you differentiate between users who can update the database, and users with just read-only access. Simply use the Windows permissions on the file to give them read+write or read-only permissions as desired.

Common mistake #1: Set user/group permissions (read-write or read-only) on the folder and let the database file (.accdb or .mdb) inherit them

In this situation, "read+write" users can create the lock file but "read-only" users cannot.

• Scenario A: If a "read+write" user opens the database first then the lock file gets created and everything operates as expected. Additional "read+write" users can open the database and make updates, and additional "read-only" users open the database read-only.

• Scenario B: If a "read-only" user opens the database file first, then their copy of Access opens the file as read-only, as expected. However, if a "read+write" user (according to their file permissions) then tries to open the database file they will open it as read-only too. Everyone can get in, but nobody can make changes.

Common mistake #2: Prohibit "create files" on the folder for everyone

In this case nobody can create the lock file so everybody opens the database read-only, regardless of their permissions on the database file itself.

Additional notes:

The results above were confirmed with a mix of Access_2010 and Access_2013 clients connecting to a shared .accdb back-end on Windows Server 2012. In earlier versions of Access, if nobody could create the lock file then the first person "in" would open the database file in "Exclusive mode" and get whatever access their file permissions allowed, while all subsequent users would be denied access with an error message stating that "The file has been opened exclusively by another user."

这篇关于如何使1用户对数据库进行更新,让别人只读在Microsoft Access?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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