重新解决问题 [英] Relinking problem

查看:61
本文介绍了重新解决问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用以下代码(在FE上的命令按钮后面)将用户的本地BE副本重新链接到LAN上的文件服务器的BE 。

我使用这个,例如,当一个人带上他们的笔记本电脑并且

连接到我们的局域网时。


如果当时没有其他用户访问服务器

BE,代码工作正常。但是,如果文件服务器的BE当时是打开的,那么,

然后重新链接过程没有完成 - 它只是暂停。当

其他所有人都关闭了数据库,然后这个过程继续在它自己的
上,笔记本电脑的FE现在链接到服务器的BE。


我们的多用户分割数据库设置正常工作 -

同时用户可以打开和关闭数据库而无需

问题 - 只要他们的FE已经链接到服务器的BE。


另一个因素:FE有一个隐藏的形式,总是打开,哪个是基于BE中的实用工具表获得



问题:

有什么我可以做的,它将允许计算机在我们的局域网上

从本地BE重新连接到服务器的BE而没有其他人

关闭数据库?


感谢您的帮助。

Mark


Dim dbs作为数据库

Dim tdf As TableDef

Dim Tdfs As TableDefs

Dim NewPathname As String

设置dbs = C urrentDb

设置Tdfs = dbs.TableDefs


''****************链接到网络驱动器 - P $ />

如果Len(Dir(P:\ fpsdata.mdb))= 0那么

MsgBox"你没有连接到网络。

恢复退出处理程序

结束如果


NewPathname =" P:\ fpsdata.mdb"


''循环通过表格集合

每个tdf在Tdf中

错误GoTo errhandler


''...链接主表

如果Len(tdf.Connect)> 0然后

tdf.Connect =" ;; DATABASE =" &安培; NewPathname

tdf.RefreshLink

结束如果

下一步''转到下一张表

I use the following code (behind a command button on the FE) to relink
from a user''s local copy of the BE to the file-server''s BE on our LAN.
I use this, for example, when a person brings in their laptop and
connects to our LAN.

The code works fine if there are no other users accessing the server''s
BE at the time. If the file-server''s BE is open at the time, however,
then the relinking process does not finish -- it just pauses. When
everyone else closes out of the database, then the process continues on
its own and the laptop''s FE is now linked to the server''s BE.

Our multi-user, split database setup works fine normally --
simultaneous users can open and close out of the database without a
problem -- as long as their FEs are already linked to the server''s BE.

One other factor: The FEs have a hidden form, always open, and which is
based on a utility table in the BE.

Question:
Is there anything I can do which will allow computers on our LAN to
relink from a local BE to the server''s BE without having everyone else
close out of the database?

Thanks for any help.
Mark

Dim dbs As Database
Dim tdf As TableDef
Dim Tdfs As TableDefs
Dim NewPathname As String
Set dbs = CurrentDb
Set Tdfs = dbs.TableDefs

''****************Link to Network Drive-P

If Len(Dir("P:\fpsdata.mdb")) = 0 Then
MsgBox "You''re not connected to the network."
Resume exithandler
End If

NewPathname = "P:\fpsdata.mdb"

''Loop through the tables collection
For Each tdf In Tdfs
On Error GoTo errhandler

''...link main tables
If Len(tdf.Connect) > 0 Then
tdf.Connect = ";DATABASE=" & NewPathname
tdf.RefreshLink
End If
Next ''Goto next table

推荐答案

< cm*@mountain.net>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...
<cm*@mountain.net> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
我使用以下代码(在FE上的命令按钮后面)将用户的本地BE副本重新链接到LAN上的文件服务器的BE。例如,当一个人带上他们的笔记本电脑并连接到我们的局域网时,我会使用它。

如果没有其他用户访问服务器,代码工作正常
当时是。但是,如果文件服务器的BE在当时打开,那么
则重新链接过程没有完成 - 它只是暂停。当其他人从数据库中关闭时,该过程将自行继续,并且笔记本电脑的FE现在链接到服务器的BE。

我们的多用户分割数据库设置正常工作 -
同时用户可以打开和关闭数据库而不会出现问题 - 只要他们的FE已经链接到服务器'' BE。

另外一个因素:FE有一个隐藏的形式,总是打开的,它基于BE中的实用工具表。

问题:
我能做些什么可以让我们局域网上的计算机从本地BE重新连接到服务器的BE而不需要其他人关闭数据库?

感谢您的帮助。
标记

Dim dbs作为数据库
Dim tdf As TableDef
Dim Tdfs As TableDef
Dim NewPathname作为字符串
设置dbs = CurrentDb
设置Tdfs = dbs.TableDefs

''****************链接到网络驱动器-P

如果Len(Dir(P:\ fpsdata.mdb))= 0那么
MsgBox你没有连接到网络。
恢复退出处理程序
结束如果

NewPathname =" P:\ fpsdata.mdb"

''循环通过表集合
对于Tdf中的每个tdf
On Error GoTo errhandler

''...链接主表
如果Len(tdf.Connect)> 0然后
tdf.Connect =" ;; DATABASE =" &安培; NewPathname
tdf.RefreshLink
结束如果
下一步''转到下一张表
I use the following code (behind a command button on the FE) to relink
from a user''s local copy of the BE to the file-server''s BE on our LAN.
I use this, for example, when a person brings in their laptop and
connects to our LAN.

The code works fine if there are no other users accessing the server''s
BE at the time. If the file-server''s BE is open at the time, however,
then the relinking process does not finish -- it just pauses. When
everyone else closes out of the database, then the process continues on
its own and the laptop''s FE is now linked to the server''s BE.

Our multi-user, split database setup works fine normally --
simultaneous users can open and close out of the database without a
problem -- as long as their FEs are already linked to the server''s BE.

One other factor: The FEs have a hidden form, always open, and which is
based on a utility table in the BE.

Question:
Is there anything I can do which will allow computers on our LAN to
relink from a local BE to the server''s BE without having everyone else
close out of the database?

Thanks for any help.
Mark

Dim dbs As Database
Dim tdf As TableDef
Dim Tdfs As TableDefs
Dim NewPathname As String
Set dbs = CurrentDb
Set Tdfs = dbs.TableDefs

''****************Link to Network Drive-P

If Len(Dir("P:\fpsdata.mdb")) = 0 Then
MsgBox "You''re not connected to the network."
Resume exithandler
End If

NewPathname = "P:\fpsdata.mdb"

''Loop through the tables collection
For Each tdf In Tdfs
On Error GoTo errhandler

''...link main tables
If Len(tdf.Connect) > 0 Then
tdf.Connect = ";DATABASE=" & NewPathname
tdf.RefreshLink
End If
Next ''Goto next table




这似乎没有非常正确 - 您应该可以重新链接,而其他人

连接到BE。如果您将表重新链接到

后端,然后允许其他人重新登录,以便您正常连接,会发生什么。在这一点

,单击按钮并重新链接(无论你是否已经正确连接了
,代码应该仍然做同样的事情) 。

这项工作,还是挂起?


你没有解释的是当你尝试重新链接时。如果你有一个

隐藏的表格连接到后端并且应该总是加载,那么如果前端表不能正常工作则无法打开。也许

这是挂起的原因。如果没有,请回复。




This doesn''t seem quite right - you should be able to re-link while others
are connected to the BE. What happens if you re-link your tables to the
back end, then allow others back in so you are all connected normally. At
this point, click the button and re-link (it doesn''t matter that you were
already correctly connected, the code should still do the same thing). Does
this work, or does it hang?

What you have not explained is when you try and re-link. If you have a
hidden form which is connected to the back end and is supposed to be always
loaded, this cannot open if your front end tables are not working. Perhaps
this is the cause of the hang. If not, post back.


感谢您回复,Anthony


(我以为我发布了回复,但我猜不!)


无论如何,

如果我的FE已经链接到P-Drive(服务器的BE),那我就可以了/>
点击重新链接按钮并重新链接到P-Drive,无论其他用户是否在数据库中,都需要多次。如果,然而,我首先重新链接到我的C驱动器的BE副本,然后尝试重新链接到P-Drive
,如果数据库中有其他用户,则操作将暂停/停止。一旦他们退出数据库,我的FE

将完成重新链接到P-Drive。


对不起,但是我我不确定我理解你的问题/评论

关于隐藏的表格和如果你的前端

表不能正常工作,则无法打开。我可能会错过你要求的东西,但是,是的,所有的桌子都在BE中,包括

隐藏形式与之相关的表格如果

FE无法链接到BE,则表单无法打开。


只是要清楚挂是什么? - 重新链接过程将在其他用户退出

数据库后立即完成重新链接。


谢谢,

Mark

Thanks for responding, Anthony

(I thought I had posted a response, but I guess not!)

Anyhow,
If my FE is already linked to the P-Drive (the server''s BE), then I can
click the re-link button and re-link to the P-Drive as many times as I
want, regardless of whether other users are in the database. If,
however, I first re-link to my C-drive''s copy of the BE and then try to
re-link to the P-Drive, the operation will pause/stop if there are
other users in the database. As soon as they exit the database, my FE
will complete the re-linking to the P-Drive.

I''m sorry, but I''m not sure I understand your question/comment
regarding the hidden form and "this cannot open if your front end
tables are not working". I''m probably missing something that you''re
asking, but yes, all the tables are in the BE, including the one the
hidden form is associated with, and true, the form cannot open if the
FE can''t link to the BE.

Just to be clear regarding "hang" -- the re-linking process will
complete the re-linking by itself as soon as other users exit the
database.

Thank you,
Mark




< cm*@mountain.net>在消息中写道

news:11 ********************** @ f14g2000cwb.googlegr oups.com ...

<cm*@mountain.net> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
我使用以下代码(在FE上的命令按钮后面)将用户的本地BE副本重新链接到LAN上的文件服务器的BE。例如,当一个人带上他们的笔记本电脑并连接到我们的局域网时,我会使用它。

如果没有其他用户访问服务器,代码工作正常
当时是。但是,如果文件服务器的BE在当时打开,那么
则重新链接过程没有完成 - 它只是暂停。当其他人从数据库中关闭时,该过程将自行继续,并且笔记本电脑的FE现在链接到服务器的BE。

我们的多用户分割数据库设置正常工作 -
同时用户可以打开和关闭数据库而不会出现问题 - 只要他们的FE已经链接到服务器'' BE。

另外一个因素:FE有一个隐藏的形式,总是打开的,它基于BE中的实用工具表。

问题:
我能做些什么可以让我们局域网上的计算机从本地BE重新连接到服务器的BE而不需要其他人关闭数据库?

感谢您的帮助。
标记

Dim dbs作为数据库
Dim tdf As TableDef
Dim Tdfs As TableDef
Dim NewPathname作为字符串
设置dbs = CurrentDb
设置Tdfs = dbs.TableDefs

''****************链接到网络驱动器-P

如果Len(Dir(P:\ fpsdata.mdb))= 0那么
MsgBox你没有连接到网络。
恢复退出处理程序
结束如果

NewPathname =" P:\ fpsdata.mdb"

''循环通过表集合
对于Tdf中的每个tdf
On Error GoTo errhandler

''...链接主表
如果Len(tdf.Connect)> 0然后
tdf.Connect =" ;; DATABASE =" &安培; NewPathname
tdf.RefreshLink
结束如果
下一步''转到下一个表
I use the following code (behind a command button on the FE) to relink
from a user''s local copy of the BE to the file-server''s BE on our LAN.
I use this, for example, when a person brings in their laptop and
connects to our LAN.

The code works fine if there are no other users accessing the server''s
BE at the time. If the file-server''s BE is open at the time, however,
then the relinking process does not finish -- it just pauses. When
everyone else closes out of the database, then the process continues on
its own and the laptop''s FE is now linked to the server''s BE.

Our multi-user, split database setup works fine normally --
simultaneous users can open and close out of the database without a
problem -- as long as their FEs are already linked to the server''s BE.

One other factor: The FEs have a hidden form, always open, and which is
based on a utility table in the BE.

Question:
Is there anything I can do which will allow computers on our LAN to
relink from a local BE to the server''s BE without having everyone else
close out of the database?

Thanks for any help.
Mark

Dim dbs As Database
Dim tdf As TableDef
Dim Tdfs As TableDefs
Dim NewPathname As String
Set dbs = CurrentDb
Set Tdfs = dbs.TableDefs

''****************Link to Network Drive-P

If Len(Dir("P:\fpsdata.mdb")) = 0 Then
MsgBox "You''re not connected to the network."
Resume exithandler
End If

NewPathname = "P:\fpsdata.mdb"

''Loop through the tables collection
For Each tdf In Tdfs
On Error GoTo errhandler

''...link main tables
If Len(tdf.Connect) > 0 Then
tdf.Connect = ";DATABASE=" & NewPathname
tdf.RefreshLink
End If
Next ''Goto next table




您无法重新挂接已打开的表。在重新附加之前,使用

打开表关闭所有表单和进程。您还应该在重新附加表格后关闭并重新打开FE

数据库。



You cannot reattach a table that is open. Close all forms and processes with
open tables before reattaching. You should also close and reopen the FE
database after reattaching the tables.


这篇关于重新解决问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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