两个用户编辑同一记录 [英] Two users editing the same record

查看:59
本文介绍了两个用户编辑同一记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个原始的,不太可能的场景,所以我可以解决这个问题:


拆分DB;前端后端。每个用户都有FE本地存储在服务器上的BE




1. UserA打开customerA的记录并编辑电话号码。

2. UserB打开相同的表格并尝试导航到customerA的

记录。


此时此刻我想要通知UserB记录已被锁定。怎么做

我这样做了吗?


我已根据其他用户的建议对OnDirty进行了测试,看起来并不好

为了掩盖这个。


谢谢,


Paul

解决方案

< blockquote>你不需要代码,只需要设置。您必须设置数据库以使用

编辑记录作为默认记录锁定选项。


如果表单在表单设计上将记录选择器属性设置为yes

(默认值),则左上角符号从实心三角形(未锁定)变为

到铅笔(更新记录但未提交)到通用否!符号,

圆圈上有对角线(锁定)。


用户可以看到其他人是否通过查看

符号。如果两个用户都在同一记录上并且UserA开始编辑,则UserB

不会看到它正在被编辑,因为当他/她到达该记录时

它没被锁定。如果UserB然后开始编辑记录,他/她不能
因为UserA已将其锁定。 UserB会发出一声嘟嘟声,符号将变为锁定(不!),而不是编辑(铅笔)。


Chris

Microsoft MVP
pa**@servicequoter.co.uk 写道:
< blockquote class =post_quotes>
>一个原始的,不太可能的场景,所以我可以理解这个:

分裂DB;前端后端。每个用户都有本地FE,BE存储在服务器上。

1。 UserA打开customerA的记录并编辑电话号码。
2。 UserB打开相同的表单并尝试导航到customerA的
记录。

此时我想通知UserB记录被锁定。我是怎么做到的?

我已经按照其他用户的建议对OnDirty进行了测试,并且似乎无法覆盖这一点。



-

通过AccessMonster.com发布消息
http://www.accessmonster.com/Uwe/For...ccess/200810/1


我忘了说表格需要将记录锁属性设置为编辑记录,




Chris

Microsoft MVP

Chris O''C写道:


>你不需要代码,只需要设置。您必须设置数据库以使用
编辑记录作为默认记录锁定选项。

如果表单在表单设计上将记录选择器属性设置为yes(默认值),左上角的符号将从实心三角形变化(未锁定) )铅笔(更新记录但没有提交)到通用的不!。符号,
它上面有对角线的圆圈(已锁定)。

用户可以通过查看
符号查看其他人是否锁定了记录。如果两个用户都在同一个记录上并且UserA开始编辑,则UserB
不会看到它正在被编辑,因为当他/她到达该记录时它没有被锁定。如果UserB然后开始编辑记录,他/她不能
因为UserA已将其锁定。 UserB会发出一声哔哔声,符号将变为锁定(不!),而不是编辑(铅笔)。

Chris
Microsoft MVP



-

通过AccessMonster.com发布消息
http://www.accessmonster.com/Uwe/For...ccess/200810/1


谢谢Chris,


在这种特殊形式中,记录选择器被隐藏。我会

实际上更喜欢使用VBA来捕获这个自定义消息,

类似于:


"记录你试图查看被另一个用户锁定。

点击确定查看记录为只读或取消以返回

列表......


我只是想知道如何将用户的到达记录在已编辑的

记录中,而无需创建我自己的IsRecordLocked。 boolean

字段,或其他一些解决方案。


类似于:


Private Sub Form_Current()

如果RecordIsBeingEditedBySomeoneElse(Me)那么

做东西

结束如果

结束子


函数需要什么代码

RecordIsBeingEditedBySomeoneElse?


谢谢,


Paul


10月8日15:52,Chris O''C通过AccessMonster.com < u29189 @ uwewrote:


你不需要代码,只需要设置。 *您必须设置db touse

编辑记录作为默认记录锁定选项。


如果表单在表单设计上将记录选择器属性设置为yes

(默认值),则左上角符号从实心三角形(未锁定)变为

到铅笔(更新记录但未提交)到通用否!符号,

圆圈上有对角线(锁定)。


用户可以看到其他人是否通过查看

符号。 *如果两个用户都在同一个记录上并且UserA开始编辑,则UserB

不会看到它正在被编辑,因为当他/她到达该记录时

它没被锁定。 *如果UserB然后开始编辑记录,他/她不能
因为UserA已将其锁定。 * UserB会发出一声哔哔声,符号将变为锁定(不!)而不是编辑(铅笔)。


Chris < br $>
Microsoft MVP


A原油,不太可能的场景,所以我可以解决这个问题:


拆分DB;前端后端。每个用户都有本地FE,BE是存储在服务器上的


1. UserA打开customerA的记录并编辑电话号码。

2. UserB打开相同的表格并尝试导航到customerA的

记录。


此时我想通知UserB该记录被锁定。怎么做

我这样做?


我已根据其他用户的建议对OnDirty进行了测试,并且它似乎无法支付这笔费用。



-

通过AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/databases-ms发布消息-access / 2008 ...


A crude, unlikely scenario just so I can get my head around this:

Split DB; front end back end. Each user has the FE locally the BE is
stored on a server.

1. UserA opens customerA''s record and edits the telephone number.
2. UserB opens the same form and tries to navigate to customerA''s
record.

At this point I want to inform UserB that the record is locked. How do
I do this?

I have tested OnDirty as suggested by other users and it doesn''t seem
to cover this.

Thanks,

Paul

解决方案

You don''t need code, just settings for this. You must set up the db to use
"edited record" as the default record locking option.

If the form has the record selector property set to yes on the form design
(the default), the upper left symbol changes from solid triangle (not locked)
to a pencil (updating record but not committed) to a universal "no!" symbol,
the circle with the diagonal line across it (locked).

The user can see if someone else has the record locked by looking at the
symbol. If both users are on the same record and UserA starts to edit, UserB
won''t see that it''s being edited because when he/she arrived on that record
it wasn''t locked. If UserB then starts editing the record, he/she can''t
because UserA has it locked. UserB will get a beep and the symbol will
change to locked ("no!") instead of edit (pencil).

Chris
Microsoft MVP
pa**@servicequoter.co.uk wrote:

>A crude, unlikely scenario just so I can get my head around this:

Split DB; front end back end. Each user has the FE locally the BE is
stored on a server.

1. UserA opens customerA''s record and edits the telephone number.
2. UserB opens the same form and tries to navigate to customerA''s
record.

At this point I want to inform UserB that the record is locked. How do
I do this?

I have tested OnDirty as suggested by other users and it doesn''t seem
to cover this.

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200810/1


I forgot to say the form needs the record locks property set to edited record,
too.

Chris
Microsoft MVP
Chris O''C wrote:

>You don''t need code, just settings for this. You must set up the db to use
"edited record" as the default record locking option.

If the form has the record selector property set to yes on the form design
(the default), the upper left symbol changes from solid triangle (not locked)
to a pencil (updating record but not committed) to a universal "no!" symbol,
the circle with the diagonal line across it (locked).

The user can see if someone else has the record locked by looking at the
symbol. If both users are on the same record and UserA starts to edit, UserB
won''t see that it''s being edited because when he/she arrived on that record
it wasn''t locked. If UserB then starts editing the record, he/she can''t
because UserA has it locked. UserB will get a beep and the symbol will
change to locked ("no!") instead of edit (pencil).

Chris
Microsoft MVP

--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200810/1


Thanks Chris,

In this particular form the record seletors are hidden. I would
actually prefer to use VBA to trap this with a custom message,
something like:

"The record you are trying to view is locked by another user.
Click OK to view the record as read only or CANCEL to return to the
list..."

I just want to know how to trap the arrival of a user on an edited
record, without having to create my own "IsRecordLocked" boolean
field, or some other solution.

Something like:

Private Sub Form_Current()
If RecordIsBeingEditedBySomeoneElse (Me) then
Do Stuff
End if
End Sub

What code needs to be in the function
RecordIsBeingEditedBySomeoneElse?

Thanks,

Paul

On 8 Oct, 15:52, "Chris O''C via AccessMonster.com" <u29189@uwewrote:

You don''t need code, just settings for this. *You must set up the db touse
"edited record" as the default record locking option.

If the form has the record selector property set to yes on the form design
(the default), the upper left symbol changes from solid triangle (not locked)
to a pencil (updating record but not committed) to a universal "no!" symbol,
the circle with the diagonal line across it (locked).

The user can see if someone else has the record locked by looking at the
symbol. *If both users are on the same record and UserA starts to edit,UserB
won''t see that it''s being edited because when he/she arrived on that record
it wasn''t locked. *If UserB then starts editing the record, he/she can''t
because UserA has it locked. *UserB will get a beep and the symbol will
change to locked ("no!") instead of edit (pencil).

Chris
Microsoft MVP

p...@servicequoter.co.uk wrote:

A crude, unlikely scenario just so I can get my head around this:

Split DB; front end back end. Each user has the FE locally the BE is
stored on a server.

1. UserA opens customerA''s record and edits the telephone number.
2. UserB opens the same form and tries to navigate to customerA''s
record.

At this point I want to inform UserB that the record is locked. How do
I do this?

I have tested OnDirty as suggested by other users and it doesn''t seem
to cover this.


--
Message posted via AccessMonster.comhttp://www.accessmonster.com/Uwe/Forums.aspx/databases-ms-access/2008...


这篇关于两个用户编辑同一记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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