基于MS Access中字段内容的用户限制 [英] User Restrictions based on Field Content in MS Access

查看:102
本文介绍了基于MS Access中字段内容的用户限制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要根据字段的值在同一张表中设置用户权限.我知道这在Access中不是直接可能的,但是Allenbrown.com上的帖子指出了一种做到这一点的方法请参见这里.我不擅长编码,因此希望能从您那里获得一些指导.详细信息如下:

I need to set up user permissions within the same table, based on the value of a field. I know that this is not directly possible in Access but a post on Allenbrown.com points to a way of doing this see here. I'm not proficient in coding so I'm hoping that I can get some directions from you. Here are the details:

我在数据库中有两个表,一个父表通过表单填充,而一个子表通过子表单填充.母公司包含公司,子公司包含这些公司的子公司.在子表中,我有一个名为"Domicile"的字段,我想以此为基础区分用户访问权限.因为该数据库将被全世界的许多人使用,所以我的计划是根据位置创建用户组,并允许用户根据他们的位置(在组中指定)和住所之间的匹配来编辑(或添加)信息.子公司.例如,即使来自其他住所的公司可能存储在同一表中,也只允许欧洲人编辑欧洲子公司的数据.

I have two tables in the database, a parent one populated via a form and a children one populated via a subform. The parent contains companies and the child contain subsidiaries of those companies. In the child table, I have a field called "Domicile" and I want to discriminate user access based on that. Because the database will be used by a variety of people worldwide, my plan is to create user groups based on location and allow users to edit (or add) information based on a match between their location (as specified in the group) and the domicile of the subsidiary. For example, a person in Europe will only be allowed to edit data for subsidiaries that are in Europe, even though companies from other domiciles may be stored in the same table.

我正在这里寻找一些指导以及关于您认为如何最有效地完成工作的建议.我并不偏爱这种方法,这只是我想出的一些逻辑,可以在我正在做的事情中添加一些逻辑.

I'm looking for some guidance here as well as suggestions as to how you think may be done most effectively. I'm not partial to this method, that's just something I came up with to put some logic behind what I'm doing.

非常感谢您!

推荐答案

在艾伦的描述中要注意的重要一点是(强调我的意思):

The important thing to note in Allen's description is (emphasis mine):

假定所有更新都是通过表单执行的,则表单的当前事件随后将基于此属性锁定字段.

Assuming all updates are performed through forms, the Current event of the form then locks the fields based on this property.

如果用户直接打开后端数据库文件,将没有实用的防弹方法来阻止用户查看和更改表中的任何数据.

There would be no practical, bulletproof way to prevent users from viewing and altering any data in the table(s) if they open the back-end database file directly.

由于您正在寻求有关如何最有效地完成[行级或列级限制]的建议,您需要解决的第一个问题是这些限制真正需要的有效性"成为:

Since you are asking for advice on how "[row- or column-level restrictions] may be done most effectively" the first issue you need to address is how "effective" those restrictions really need to be:

  1. 如果您可以接受这些将是软限制"(确实是为了方便用户,以便他们在使用表单时不会意外更改某些记录或字段),那么Allen的方法可能就足够了. (如果是这样,请尽最大可能按照Allen的指示进行操作,如果您需要有关该实现的特定方面的帮助,请询问新问题. )

另一方面,如果您需要硬性限制"(针对恶作剧或恶意用户活动的认真保护),则必须使用其他数据库后端-例如Microsoft SQL Server-带有一组更丰富的安全工具供您使用.

On the other hand, if you need "hard restrictions" (serious protection against mischievous or malevolent user activity) then you'll have to employ a different database back-end -- something like Microsoft SQL Server -- with a richer set of security tools for you to use.

这篇关于基于MS Access中字段内容的用户限制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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