如何避免(不希望的,间歇性的)独占锁? [英] How to avoid (undesired, intermittently-occurring) exclusive locks?

查看:72
本文介绍了如何避免(不希望的,间歇性的)独占锁?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个数据库,其后端位于服务器上,每个用户在其计算机桌面上都有自己的前端。对于第一个用户在早上打开前端的定期(不经常),Access会在服务器上写一个独占锁,并且在该用户退出之前没有其他人能够进入。


有没有办法让我把前面的东西放在锁上看看,如果它是独占的(并假设Access可以在内部检测到这一点)有前面的话结束自己(Application.Quit)?到目前为止,它从来没有立刻第二次(个人,我认为这是一个Access错误),所以我认为这将为我们解决这个问题。


关于这一点的任何其他建议也将被热切地接受!

I have a database whose back end sits on a server, and each user has their own front end on their computer''s desktop. Periodically (infrequently), for the first user to open their front end in the morning, Access writes an exclusive lock on the server, and no one else is able to get in until that user exits.

Is there a way for me to put into the front end something that would look at the lock and, if it were exclusive (and assuming Access can detect this internally) to have the front end close itself ("Application.Quit")? So far, it''s never done this immediately a second time (personally, I think it''s an Access bug), so I think this would solve this problem for us.

Any other suggestions about this will be eagerly accepted, as well!

推荐答案

现在没有时间进行全面研究,但你可以从应用程序开始。 SetOption(默认记录锁定,...)
No time now for full research, but you could start by looking into Application.SetOption("Default Record Locking", ...).


谢谢, NeoPa !我肯定会这样做,并会发回我发现的任何有用的东西。
Thanks, NeoPa! I''ll certainly do that, and will post back anything useful I discover.


这里有一些东西:


在Microsoft支持上网站,文章ACC:.LDB文件简介(1.x / 2.0):


"但是,.LDB文件没有向Microsoft Access提供有关谁专门打开数据库的信息,因为这是由SHARE.EXE(或Windows 3.1中的VSHARE.386)处理的。这些程序不会向Microsoft Access返回有关谁打开数据库的信息。


因此它开始看起来好像我实际上能够获取已创建的锁的类型。还在研究,... ...
Here''s something:

On the Microsoft support site, there is this paragraph in the article "ACC: Introduction to .LDB Files (1.x/2.0)":

"However, the .LDB file does not give Microsoft Access information about who has a database opened exclusively, because this is handled by SHARE.EXE (or VSHARE.386 in Windows 3.1). Those programs do not return information to Microsoft Access about who has the database open."

So it begins to look as though I actually will not be able to get at the type of lock that has been created. Still researching, tho...


这篇关于如何避免(不希望的,间歇性的)独占锁?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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