473,791 Members | 3,277 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Relinking problem

cmd
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:\fps data.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

Jan 12 '06
23 2379

<cm*@mountain.n et> wrote in message
news:11******** **************@ g44g2000cwa.goo glegroups.com.. .
Thank you, Ron.
I'll give that a try, but I think your initial caution about not being
able to re-attach to open tables is correct, and even though it
appeared I was doing just that, the database was probably just
confirming the links as they had already existed -- and, therefore, not
hanging up, or producing an error of some kind.

Mark


The caution of open tables was only for tables opened by the FE database
doing the re-attached. You should be able to attach to the BE while other
users have it open, unless someone has it open exclusively.
Jan 12 '06 #11
"paii, Ron" <pa**@packairin c.com> wrote in
news:Fe******** ************@at henet.net:
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.


On this latter point, why? I've never done so, ever -- not even once
-- and my computer, nor any computer belonging to my clients, has
ever exploded or anything.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jan 12 '06 #12
"paii, Ron" <pa**@packairin c.com> wrote in
news:go******** ************@at henet.net:
Here is a snippet of the code I have been using since 94.
Some of it came from Solutions.MDB which was part of Access 2
This code deletes the table attachment then creates a new
attachment. This may or may not be the problem, but it works from
me.

CurDB.TableDefs .Delete "Table Name"
Set CurTable = CurDB.CreateTab leDef("TableNam e")
CurTable.Connec t = ";DATABASE= " & filename

CurTable.Source TableName = "Table Name"
CurDB.TableDefs .Append CurTable

CurTable.Refres hLink


This can be orders of magnitude slower than updating the connect
string. It isn't in all cases, but I've seen it take *MUCH* longer
than the former.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/
Jan 12 '06 #13
cmd
Ron,

Are you saying that as long as the FE first closes all of its open
tables, then it should be able to attach to the BE's tables on the
server regardless of whether anyone else is in the database (provided
they haven't opened it exclusively)?

If that's what you're saying, then I guess when my FE is already
attached to the BE on the server and I click the re-attach button --
which first closes the hidden form -- then the FE does in fact
re-attache to all the tables in the server's BE.

But, why would the same process "hang" until other users have exited
the database in the case where my FE was initially linked to my local
BE? The hidden form is still closed first before trying to attach to
the server's BE.

Mark

Jan 13 '06 #14

"David W. Fenton" <XX*******@dfen ton.com.invalid > wrote in message
news:Xn******** *************** ***********@127 .0.0.1...
"paii, Ron" <pa**@packairin c.com> wrote in
news:Fe******** ************@at henet.net:
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.


On this latter point, why? I've never done so, ever -- not even once
-- and my computer, nor any computer belonging to my clients, has
ever exploded or anything.

--
David W. Fenton http://www.dfenton.com/
usenet at dfenton dot com http://www.dfenton.com/DFA/


My reason goes back to the original code and Access 2, which behaved
strangely if I didn't reopen the FE. It has works in my environment so I
haven't changed the procedure. Also my applications get startup data from
the BE, without the restart I would need to call a function to reinitialize
the app.

I use re-attach to change to a different BE, normally to attach my
developmental FE to the production BE before distributing it to the users.
Jan 13 '06 #15

<cm*@mountain.n et> wrote in message
news:11******** **************@ g43g2000cwa.goo glegroups.com.. .
Ron,

Are you saying that as long as the FE first closes all of its open
tables, then it should be able to attach to the BE's tables on the
server regardless of whether anyone else is in the database (provided
they haven't opened it exclusively)?

If that's what you're saying, then I guess when my FE is already
attached to the BE on the server and I click the re-attach button --
which first closes the hidden form -- then the FE does in fact
re-attache to all the tables in the server's BE.

But, why would the same process "hang" until other users have exited
the database in the case where my FE was initially linked to my local
BE? The hidden form is still closed first before trying to attach to
the server's BE.

Mark


I just re-attached to a BE opened and by 4 or 5 users, so the process works.
All I can suggest is to do a compact and repair on the BE. Also add some
code to your re-attach function to output each table name before you attempt
to refresh. Is it the same table hanging? If so, verify the table is ok and
that your users FE doesn't lock the table at some point..
Jan 13 '06 #16
cmd
Ron,

When you re-attached to the BE, had your FE already been attached to
that same BE? My problem only occurs if my FE is initially attached to
C:\Access97 (a laptop's BE brought from home, for example) and I then
try to attach to P:\Access97, i.e., the server's BE. ("Access97" is
just the name of the folder where I place local and server BEs).

To clarify ... I'm just using the word "hang" the same as I would the
word "pause". There does not seem to be any error generated. My "Please
Wait" pop-up form just sits there until any other users close out of
the database. As soon as they do, the pop-up form closes and the tables
have been attached to the server's BE.

Mark

Jan 13 '06 #17

<cm*@mountain.n et> wrote in message
news:11******** **************@ g49g2000cwa.goo glegroups.com.. .
Ron,

When you re-attached to the BE, had your FE already been attached to
that same BE? My problem only occurs if my FE is initially attached to
Normally I am changing from a local Test copy of the BE, to the shared copy
on a server.
C:\Access97 (a laptop's BE brought from home, for example) and I then
try to attach to P:\Access97, i.e., the server's BE. ("Access97" is
just the name of the folder where I place local and server BEs).

To clarify ... I'm just using the word "hang" the same as I would the
word "pause". There does not seem to be any error generated. My "Please
Wait" pop-up form just sits there until any other users close out of
the database. As soon as they do, the pop-up form closes and the tables
have been attached to the server's BE.

Mark

Jan 13 '06 #18
cmd
Normally I am changing from a local Test copy of the BE, to the shared
copy
on a server.

--That sounds just like what I'm doing.

If an error was being produced, I could probably identify what was
happening. But, since the process is only pausing, I'm not sure how I
would identify any particular table that might be stopping the process
until other users log out. Furthermore, it's the same FE that has no
problems re-attaching even with other users in the database -- provided
that the FE started out as attached to P:\Access97. The BE on my local
drive is also the same as the BE on the server -- I frequently copy it
from the server to my development computer.

Jan 13 '06 #19

<cm*@mountain.n et> wrote in message
news:11******** **************@ g47g2000cwa.goo glegroups.com.. .
Normally I am changing from a local Test copy of the BE, to the shared
copy
on a server.

--That sounds just like what I'm doing.

If an error was being produced, I could probably identify what was
happening. But, since the process is only pausing, I'm not sure how I
would identify any particular table that might be stopping the process
until other users log out.
from your code

If Len(tdf.Connect ) > 0 Then

' I am guessing you can get the table name like this. Otherwise check Access
help.
msgbox tdf.Name

tdf.Connect = ";DATABASE= " & NewPathname
tdf.RefreshLink
End If
Furthermore, it's the same FE that has no problems re-attaching even with other users in the database -- provided
that the FE started out as attached to P:\Access97. The BE on my local
drive is also the same as the BE on the server -- I frequently copy it
from the server to my development computer.

By the way I am also using Access97.

Also check that you have the sr2b service pack installed.


Jan 13 '06 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

117
7273
by: Peter Olcott | last post by:
www.halting-problem.com
4
2074
by: Ray | last post by:
I have a split DB running on a network, with code to relink to tables on launch of the client is they are broken. Usually, this works fine, but for some reason just hangs if another user is using the system. Any idea why and what I can do about it? Ray
6
2538
by: Don Leverton | last post by:
Hi All, I've got a situation where I am developing an Access 97 app for a client, and am in the "beta testing" stage. I have split the app up, using the DB splitter, into front-end /back-end for the usual reason ... so I can mess with form/report revisions. Since splitting, I've had issues with re-linking the tables ... as it relates to the completetely different "My Documents" data paths on several different Win98 / Win XP computers.
0
1898
by: Rob | last post by:
I need to allow a user with the default "Full Data User" permissions on the front-end database to relink to a table in a backend to which he has the same permissions. (I'd like to do read, update, insert, delete, which are the DEFAULTS for a "Full data user", but just so you know I have also added "Administrator" for this group in front and backends, just to try and figure out the problem and it didn't help). Anyway I cycle through the...
5
1847
by: Bill Stock | last post by:
I'm inherited a database that has a few issues. One of the less severe issues, but the one the users bitch about is the speed across the LAN. So I thought that I could unbind the NUMEROUS subforms on the tab control. So I unbound the 25+ subforms and added an OnChange event to the Tab Control. Only about 2/3 of the subforms have reappeared. I've been over the names again and got a few more working, but there are some that just won't come...
1
1659
by: Zlatko Matiæ | last post by:
Is there any common method for programatical relinking of linked tables?
13
4521
by: Arno R | last post by:
Hi all, I am deploying an A2k app to users with different versions of Access. Using Access 2000 the relinking on startup (on deploying a new frontend or when backend has changed) is very fast. It takes about 4-5 seconds to relink some 50 tables. (I am relinking, not refreshing) Using Access 2003 the relinking is very slow compared with Access 2000. Now It takes about 1,5 to 2 minutes !! to relink the same 50 tables. I am testing...
5
1898
by: mark_aok | last post by:
Hi all, I have a situation where I have a split database. At the back end, I need to - create a new table (I will call it newTable) with the exact fields, and relationships as another table (let's call it oldTable, and I need to copy everything EXCEPT the data). - Then I need to delete oldTable, and rename newTable 'oldTable'
1
2947
by: atlbearcat | last post by:
Hello all I have a database that uses quite a few tables from SQL server. The problem is that when I post a new version of the database, I have to manually relink the SQL tables via the Linked Table Manager. Does anyone know of a way to either automatically relink the tables or code to put behind a button to do the same? Any help would be appreciated! Thanks...
0
9669
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9517
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10428
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10207
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9997
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6776
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5435
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4110
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3718
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.