设为首页收藏本站Access中国

Office中国论坛/Access中国论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

返回列表 发新帖
查看: 2744|回复: 3
打印 上一主题 下一主题

[表] 如何设定表中某个字段只读,其余字段读写? 谢

[复制链接]
跳转到指定楼层
1#
发表于 2016-4-19 15:37:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
如题, 在窗体中可以实现。 但在表中如何设定某个字段只读,其余字段读写? 请大神解答。 多谢。
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏 分享分享 分享淘帖 订阅订阅
2#
发表于 2016-4-19 16:18:48 | 只看该作者
1、如果使用工作组的话,可以设置表数据的增删改查权限。但数据表不提供这样的属性。
2、出于数据安全性的考虑,一般不会让用户直接使用数据表来对记录进行操作,而是通过窗体为媒介来完成用户交互过程。
3、事实上,所有数据库都没有这样的功能。
3#
 楼主| 发表于 2016-4-19 16:26:24 | 只看该作者
roych 发表于 2016-4-19 16:18
1、如果使用工作组的话,可以设置表数据的增删改查权限。但数据表不提供这样的属性。
2、出于数据安全性的 ...

谢谢 建议, 我找到方法了。 目前实现1,2列只读, 3~8列读写:
Once the data has been entered:
1. Open the table in design view.

2. Open the Properties box (View menu).

3. Beside the table's Validation Rule in the Properties box (not the
Validation Rule in the lower pane of the table design window, which applies
to a field), enter:
False

4. Save, answering No to the question about testing existing data.

The Validation Rule is an expression that evaluates to True or False. Since
this expression is always false, Access won't allow any entries or
alterations. You will need to prevent deletions in the form (set
AllowDeletions to No.)

If you need to do this programmatically, CreateProperty() on the TableDef().

Of course, full-blown Access security is the more comprehensive solution.
4#
发表于 2016-4-19 17:05:07 | 只看该作者
irfhzk 发表于 2016-4-19 16:26
谢谢 建议, 我找到方法了。 目前实现1,2列只读, 3~8列读写:
Once the data has been entered:
1. Op ...

太复杂。那两列一直留空?如果需要录入数据时怎么办?
为此用createProperty方法来创建属性?这并不比在窗体实现容易吧?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|站长邮箱|小黑屋|手机版|Office中国/Access中国 ( 粤ICP备10043721号-1 )  

GMT+8, 2024-4-29 04:06 , Processed in 0.073057 second(s), 27 queries .

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表