Access 97 - 多用户数据库和损坏 [英] Access 97 - Multiuser databases and corruption

查看:112
本文介绍了Access 97 - 多用户数据库和损坏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只是花了一些时间浏览常见问题解答网站并搜索这个新闻组的

google档案,但我还是没有能够

找到多用户数据库问题的清晰解释。


基本上我有两个问题;


1)是不是system.mdw文件对多用户有什么意义

共享除安全性之外的Access 97数据库?


2)任意数量的用户都可以打开Access 97数据库使用system.mdw中相同的

帐户而不破坏数据库?


到目前为止,我一直在努力确保每个用户

在system.mdw中有一个唯一的帐户,并且任何连接到

的用户都使用相同的system.mdw。如果每个

用户没有必要拥有一个独特的帐户,那么拥有一个

单个通用用户帐户和一个标准桌面快捷方式就会简单得多

前端。


我找不到任何能清楚解释锁定系统的资源

Access。我的印象是,当用户连接到数据库时,

创建了一个LDB文件,其中包含连接的详细信息。

存储在LDB文件中的信息如图所示通过Microsoft LDB

查看器工具似乎与计算机名称相关,使得

连接*不是来自system.mdw的用户帐户,因此可能是

如果在几台不同的
计算机上使用相同的帐户并不重要,因为锁定对于PC名称是唯一的。


* *似乎导致问题的原因是未能在

all使用system.mdw;这意味着一个不安全的数据库的几个用户连接为管理员。来自c:\windows \ system32中的system.mdw。在

对象权利条款中,安全性并不特别重要。

在相关数据库中。


有标准桌面包含登录帐户的快捷方式如命令行的一部分将使分发应用程序

更加简单。


如果任何人都深入了解system.mdw文件和

ldb文件的行为,请告诉我这些

数据库的设置是否可以简化...


Rob

解决方案

已回复嵌入式。


- -

Allen Browne - 微软MVP。西澳大利亚州珀斯。

访问用户提示 - http:// allenbrowne.com/tips.html

回复群组,而不是mvps dot org的allenbrowne。

" Rob Geraghty" <第******** @ yahoo.com>在留言中写道

news:b7 ************************** @ posting.google.c om ...

我刚刚花了一些时间浏览常见问题解答网站并搜索这个新闻组的谷歌档案,但我仍然无法找到一个明确的解释多用户数据库的问题。

基本上我有两个问题;

1)system.mdw文件对多用户有什么意义共享除安全性之外的Access 97数据库?


No.

2)任何数量的用户都可以使用system.mdw中相同的
帐户打开Access 97数据库而不会破坏数据库?


是的。那是正常的。如果您创建一个名为Level2的用户,并分配

所需的权限,则几个用户可以同时以Level2身份登录。

我有什么到目前为止一直在努力确保每个用户在system.mdw中都有一个唯一的帐户,并且任何连接到数据库的用户都使用相同的system.mdw。如果每个
用户都没有必要拥有一个独特的帐户,那么拥有一个单一的通用用户帐户和一个标准的桌面快捷方式就可以更加简单。 。


好​​吧,CurrentUser()返回登录用户的名字,如果你想这样做的话,这可能是

的信息,但它'没有必要,如果你需要的话,你可以从Jet用户名单中获得计算机名称。

我找不到任何能清楚解释锁定系统的资源在
访问。我的印象是,当用户连接到数据库时,会创建一个LDB文件,其中包含连接的详细信息。
存储在LDB文件中的信息,如Microsoft LDB所示
查看器工具似乎与计算机名称相关,使得
连接*不是来自system.mdw的用户帐户,所以大概是不应该在几个不同的帐户上使用相同的帐户
计算机,因为锁定是PC名称的唯一。


老鼠:你正在使用A97。 Jet用户名单适用于A2000及更高版本(使用

ADO),但它显示了Computer_Name,Login_Name,Connected(y / n)和一个

Suspect_State代码。

* *似乎导致问题的原因是未能在
全部使用system.mdw;这意味着不安全数据库的几个用户以管理员身份连接。来自c:\windows \ system32中的system.mdw。在对象权利方面,安全性在相关数据库中并不特别重要。


不,这根本没有问题。事实上,这是一个非常好的例子

的许多用户使用相同的登录名进行连接。我个人觉得

大多数安装都不需要访问安全性,而且每天运行的数百万个Access数据库都没有设置安全性,

即使用默认的system.mdw,这样的场景可能是最多的b bb测试。地球上的数据库设置。

使用标准桌面快捷方式(包括登录帐户作为命令行的一部分)将使应用程序的分发更加简单。


是的。当然,快捷方式中的system.mdw必须是

服务器上的系统,因此您只需管理一个文件。

如果有人深入了解system.mdw文件和
ldb文件的行为如何,请告诉我这些数据库的设置是否可以简化......




如果您确实可以访问Access 2000或更高版本,则下面的函数会将其读取到Access中,以便检查其内容。返回值是当前连接的不同用户的数量



函数UserCount()As Long

Dim cnLocal作为ADODB。连接''当前项目连接。

Dim cnBackEnd As New ADODB.Connection''连接到后端

数据库。

Dim rsBEUserRoster As New ADODB.Recordset''JET User Roster for back

结束数据库。

Dim rsTarget As New ADODB.Recordset''Temp表记录用户

和重复数据删除。

Dim strPath As String''到后端的完整路径。

Dim strSql As String''SQL string。

Dim lngKt As Long''Loop controller。

Dim dtEnteredOn As Date''当前日期和时间。


''将此设置为完整路径你的后端数据库。

strPath =" C:\ Data \Northwind2003.mdb&


''打开后端的JET用户名单。

cnBackEnd.Provider =" Microsoft.Jet.OLEDB.4.0"

cnBackEnd.Open" Data Source =" &安培; strPath

设置rsBEUserRoster = cnBackEnd.OpenSchema(adSchemaProviderSpecific ,, _

" {947bb102-5d43-11d1-bdbf-00c04fb92675}")


''清除临时表,并复制用户名单。

dtEnteredOn =现在()

设置cnLocal = CurrentProject.Connection

cnLocal.Execute" DELETE FROM tzJetUserRoster;"

rsTarget.Open" tzJetUserRoster",cnLocal,adOpenDynamic,

adLockOptimistic

Do while not rsBEUserRoster.EOF

rsTarget.AddNew

对于lngKt = 0到3

rsTarget(lngKt)= rsBEUserRoster(lngKt)

rsTarget!EnteredOn = dtEnteredOn

下一页

rsTarget.Update

rsBEUserRoster.MoveNext

循环

rsTarget.Close

rsBEUserRoster.Close

cnBackEnd.Close


''获取已连接的不同用户的数量。

strSql =" SELECT DISTINCT Computer_Name FROM tzJetUserRoster WHERE

Connected = True;"

设置rsTarget =新ADODB.Recordset

rsTarget.Open strSql,cnLocal,adOpenKeyset

如果不是(rsTarget.BOF和rsTarget.EOF)那么

rsTarget.MoveLast

UserCount = rsTarget.RecordCount

结束如果

rsTarget.Close


''取消引用对象

设置rsTarget = Nothing

Set rsBEUserRoster = Nothing

设置cnLocal = Nothing

设置cnBackEnd = Nothing

结束功能


< blockquote> th********@yahoo.com (Rob Geraghty)写道:

如果每个
用户都没有必要拥有一个独特的帐户,那么拥有一个单一的通用用户帐户和一个标准桌面会简单得多前端的快捷方式。




前端是什么意思?每个用户都应该拥有自己的 - 如果

你有多个用户访问相同的FE,那么这可能会导致

损坏。


此致,

Keith。
www.keithwilby.com


Keith Wilby< ke ********* @ AwayWithYerCrap.com>在消息新闻中写道:< Xn ************************ @ 10.15.188.42> ...

< a href =mailto:th ******** @ yahoo.com> th ******** @ yahoo.com (Rob Geraghty)写道:

如果每个
用户没有必要拥有一个独特的帐户,那么拥有一个单一的通用用户帐户和一个标准的桌面快捷方式就可以简单得多了。前端。


前端是什么意思?每个用户都应该有自己的 - 如果你有多个用户访问相同的FE,那么这可能会导致损坏。




为什么会导致腐败?我们有一堆数据库,其中

用户在服务器上打开相同的前端文件,并且他们不会一直损坏
。他们被破坏的通常原因是个人电脑遇到网络问题而且没有

以干净的方式退出应用程序时重新启动。

在服务器上使用单个前端消除了分发文件的需要 - 你只需要分发快捷方式。

更新前端意味着在一个地方改变它。加载

前端有点慢,但在100Mb / s的交换网络上,

的速度差异并不值得担心。

当网络速度较慢时,分发前端文件会产生意义,特别是如果它们很大的话。但是有了一个快速的网络,我不能看到它的理由。


现在人们开始惹我生气并说有是你的问题,

我希望听到一个解释*为什么*从服务器打开

前端的几个副本会导致损坏。


话虽如此,正如我所说,我们已经拥有了许多数据库

在服务器上运行拆分前端后端和
上的快捷方式
桌面多年 - 没有严重的腐败问题。

我的原始帖子的要点是弄清楚系统是否可以进一步简化为
MDW

文件中的单个通用用户帐户,并将帐户名和密码放入快捷方式。由于

锁定文件似乎记录了将数据连接到数据库的计算机的详细信息,而不是使用的帐户,应该没问题。

问候,

Rob


Rob


I''ve just spent some time looking through FAQ sites and searching the
google archives of this newsgroup, but I still haven''t been able to
find a clear explanation of an issue with multi-user databases.

Essentially I have two questions;

1) Does the system.mdw file have any significance to multi-user
sharing of an Access 97 database other than security?

2) Can any number of users open an Access 97 database using the same
account from the system.mdw without corrupting the database?

What I have been doing up until now is trying to ensure that each user
has a unique account in the system.mdw and that any user connecting to
the database uses the same system.mdw. If it''s not necessary for each
user to have a unique account, it would be much simpler to have a
single generic user account and a single standard desktop shortcut to
the front end.

I can''t find any resources which clearly explain the locking system in
Access. My impression is that when a user connects to the database,
an LDB file is created which contains the details of the connection.
The information stored in the LDB file as shown by the Microsoft LDB
viewer tool appears to be related to the computer name making the
connection *not* the user account from the system.mdw, so presumably
it shouldn''t matter if the same account is used on several different
computers because the locking is unique to the PC name.

What *does* seem to cause problems is failing to use a system.mdw at
all; which means that several users of an unsecured database are
connecting as "admin" from the system.mdw in c:\windows\system32. In
terms of rights to objects, security is not of particular importance
in the databases in question.

Having standard desktop shortcuts which include the login account as
part of the command line would make distribution of the applications
much simpler.

If anyone has in depth knowledge of how the system.mdw file and the
ldb files behave, please let me know whether the setup for these
databases can be simplified...

Rob

解决方案

Answered embedded.

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
"Rob Geraghty" <th********@yahoo.com> wrote in message
news:b7**************************@posting.google.c om...

I''ve just spent some time looking through FAQ sites and searching the
google archives of this newsgroup, but I still haven''t been able to
find a clear explanation of an issue with multi-user databases.

Essentially I have two questions;

1) Does the system.mdw file have any significance to multi-user
sharing of an Access 97 database other than security?
No.
2) Can any number of users open an Access 97 database using the same
account from the system.mdw without corrupting the database?
Yes. That''s normal. If you create a user named say "Level2", and assign the
desired priviliges, several users can all log in as Level2 at the same time.
What I have been doing up until now is trying to ensure that each user
has a unique account in the system.mdw and that any user connecting to
the database uses the same system.mdw. If it''s not necessary for each
user to have a unique account, it would be much simpler to have a
single generic user account and a single standard desktop shortcut to
the front end.
Well, CurrentUser() returns the name of the logged in user, which may be
informative if you want to do it that way, but it''s not necessary and you
can get the Computer_Name from the Jet User Roster if you need it.
I can''t find any resources which clearly explain the locking system in
Access. My impression is that when a user connects to the database,
an LDB file is created which contains the details of the connection.
The information stored in the LDB file as shown by the Microsoft LDB
viewer tool appears to be related to the computer name making the
connection *not* the user account from the system.mdw, so presumably
it shouldn''t matter if the same account is used on several different
computers because the locking is unique to the PC name.
Rats: you''re using A97. The Jet User Roster is for A2000 and later (uses
ADO), but it shows the Computer_Name, Login_Name, Connected (y/n), and a
Suspect_State code.
What *does* seem to cause problems is failing to use a system.mdw at
all; which means that several users of an unsecured database are
connecting as "admin" from the system.mdw in c:\windows\system32. In
terms of rights to objects, security is not of particular importance
in the databases in question.
No, there is no problem with that at all. In fact, it''s a very good example
of lots of users conneting with the same log-in name. Personally I find
Access security unnecessary for most installations, and there are literally
millions of Access databases running every day without setting up security,
i.e. using the default system.mdw, so that scenario is probably the most
"tested" database setup on the planet.
Having standard desktop shortcuts which include the login account as
part of the command line would make distribution of the applications
much simpler.
Yes. And of course the system.mdw in the shortcut must be the one on the
server, so you only have one file to manage.
If anyone has in depth knowledge of how the system.mdw file and the
ldb files behave, please let me know whether the setup for these
databases can be simplified...



If you do have access to Access 2000 or later, the function below reads it
into an Access so you can examine its contents. Return value is the number
of distinct users currently connected.

Function UserCount() As Long
Dim cnLocal As ADODB.Connection ''Current project connection.
Dim cnBackEnd As New ADODB.Connection ''Connection to back end
database.
Dim rsBEUserRoster As New ADODB.Recordset ''JET User Roster for back
end database.
Dim rsTarget As New ADODB.Recordset ''Temp table to record users
and de-dupe.
Dim strPath As String ''Full path to back end.
Dim strSql As String ''SQL string.
Dim lngKt As Long ''Loop controller.
Dim dtEnteredOn As Date ''Current date and time.

''Set this to the full path of your back end database.
strPath = "C:\Data\Northwind2003.mdb"

''Open the JET User Roster for the back end.
cnBackEnd.Provider = "Microsoft.Jet.OLEDB.4.0"
cnBackEnd.Open "Data Source=" & strPath
Set rsBEUserRoster = cnBackEnd.OpenSchema(adSchemaProviderSpecific, , _
"{947bb102-5d43-11d1-bdbf-00c04fb92675}")

''Clear temp table, and copy the user roster in.
dtEnteredOn = Now()
Set cnLocal = CurrentProject.Connection
cnLocal.Execute "DELETE FROM tzJetUserRoster;"
rsTarget.Open "tzJetUserRoster", cnLocal, adOpenDynamic,
adLockOptimistic
Do While Not rsBEUserRoster.EOF
rsTarget.AddNew
For lngKt = 0 To 3
rsTarget(lngKt) = rsBEUserRoster(lngKt)
rsTarget!EnteredOn = dtEnteredOn
Next
rsTarget.Update
rsBEUserRoster.MoveNext
Loop
rsTarget.Close
rsBEUserRoster.Close
cnBackEnd.Close

''Get the count of the number of distinct users who are connected.
strSql = "SELECT DISTINCT Computer_Name FROM tzJetUserRoster WHERE
Connected = True;"
Set rsTarget = New ADODB.Recordset
rsTarget.Open strSql, cnLocal, adOpenKeyset
If Not (rsTarget.BOF And rsTarget.EOF) Then
rsTarget.MoveLast
UserCount = rsTarget.RecordCount
End If
rsTarget.Close

''Dereference objects
Set rsTarget = Nothing
Set rsBEUserRoster = Nothing
Set cnLocal = Nothing
Set cnBackEnd = Nothing
End Function


th********@yahoo.com (Rob Geraghty) wrote:

If it''s not necessary for each
user to have a unique account, it would be much simpler to have a
single generic user account and a single standard desktop shortcut to
the front end.



What do you mean by "the front end"? Each user should have their own - if
you have multiple users accessing the same FE then this might cause
corruption.

Regards,
Keith.
www.keithwilby.com


Keith Wilby <ke*********@AwayWithYerCrap.com> wrote in message news:<Xn************************@10.15.188.42>...

th********@yahoo.com (Rob Geraghty) wrote:

If it''s not necessary for each
user to have a unique account, it would be much simpler to have a
single generic user account and a single standard desktop shortcut to
the front end.


What do you mean by "the front end"? Each user should have their own - if
you have multiple users accessing the same FE then this might cause
corruption.



Why would it cause corruption? We have a stack of databases where
users open the same front end file on the server, and they don''t get
corrupted all the time. The usual reason they become corrupted is
that an individual PC had a network problem and was rebooted without
exiting the application in a clean way.

Using a single front end on the server eliminates the need to
distribute the files - you only need to distribute the shortcut.
Updating the front end means changing it in one place. Loading the
front end is a little slower but on a 100Mb/s switched network the
speed difference isn''t worth worrying about.

When the network was slower, distributing the front end files made
sense, especially if they were large. But with a fast network, I
can''t see a reason for it.

Now before people start flaming me and saying "there''s your problem",
I''d prefer to hear an explanation *why* opening several copies of the
front end from the server would cause corruption.

Having said that, as I mentioned we''ve had a number of databases
operating with split front end back end on the server and shortcuts on
the desktop for years - without significant problems of corruption.
The point of my original post was to figure out if the system could be
further simplified by having a single generic user account in the MDW
file, and put the account name and password into the shortcut. Since
the lock file seems to record the details of the computer connecting
to the database, not the account used, it should be OK.

Regards,
Rob

Rob


这篇关于Access 97 - 多用户数据库和损坏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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