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 23 2377
<cm*@mountain.n et> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. . 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
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.
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.n et> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. . 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
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.
Thanks, Ron
but ... the re-link process seems to work fine if I'm already connected
to my local copy of the BE and re-link to that same location. Also, it
works fine if I'm already connected to the server's BE and re-link to
that location, provided no one else is in the database. In both case,
the hidden file is open and connected to the respective BE.
Mark
My bad!
Sorry, Ron ... I missed seeing a step at the beginning of my code where
I do, in fact, close the hidden file before going to the re-link step.
Mark
Ron,
Any thoughts as to why I can re-link to the server's BE -- even though
there are other users in the database -- *provided* that my FE was
linked to that BE prior to me clicking the re-link button? In this
case, the process doesn't "hang"; but it will if my FE had first been
linked to my local BE.
Mark
(talking to myself)
-- probably because it's not actually re-linking?
<cm*@mountain.n et> wrote in message
news:11******** ************@f1 4g2000cwb.googl egroups.com... Ron,
Any thoughts as to why I can re-link to the server's BE -- even though there are other users in the database -- *provided* that my FE was linked to that BE prior to me clicking the re-link button? In this case, the process doesn't "hang"; but it will if my FE had first been linked to my local BE.
Mark
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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Peter Olcott |
last post by:
www.halting-problem.com
|
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
|
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.
|
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...
|
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...
| |
by: Zlatko Matić |
last post by:
Is there any common method for programatical relinking of linked tables?
|
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...
|
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'
|
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...
|
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,...
|
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...
| |
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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();...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
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
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |