473,385 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Linked Tables need to be relinked often

I have two databases. One is the application and the other is the data. The application is loaded on the individual computers and the data is on a microsoft server. I used the link table manager to link the tables but they don't seem to stay linked. The users have to relink the tables. Have not seen this happen before so I was wondering if anyone else has ever seen this problem. Any suggestion would be appreciated.
Oct 22 '07 #1
1 1672
ADezii
8,834 Expert 8TB
I have two databases. One is the application and the other is the data. The application is loaded on the individual computers and the data is on a microsoft server. I used the link table manager to link the tables but they don't seem to stay linked. The users have to relink the tables. Have not seen this happen before so I was wondering if anyone else has ever seen this problem. Any suggestion would be appreciated.
I personally have never seen this problem, but if you cannot correct it, the least you can do is automate the process of Re-Linking the Tables. Here is a custom routine I wrote which will accomplish just that. Use this as a last resort - let's wait and see if someone can come up with a solution.
  1. Create a Local Table named tblLinkedTables.
  2. This Table should consist of just 2 Fields [ID] (AutoNumber) [Primary Key], and [Table Name] (TEXT).
  3. Into this Table, add the Names of all Tables which should be linked.
  4. The code will check the Table Names in tblLinkedTables against all the Tables in the Database. If they exist and are Linked nothing happens, but if they do not exist, the code will Re-Link them automatically.
  5. You will need to make at least 1 adjustment, being the Path to the Back End Data, but all should work well.
  6. I tested the code and it is functional, but then again it was close to bedtime, so perform this operation on backup copies of your Front and Back Ends.
  7. Any questions, feel free to ask.
    Expand|Select|Wrap|Line Numbers
    1. Dim MyDB As DAO.Database, MyRS As DAO.Recordset, tdf As DAO.TableDef
    2. Dim blnLinked As Boolean, strPathToData
    3.  
    4. strPathToData = "C:\Haz-Mat\HMAU_Data.mdb"
    5.  
    6. Set MyDB = CurrentDb()
    7. Set MyRS = MyDB.OpenRecordset("tblLinkedTables", dbOpenSnapshot)
    8.  
    9. MyRS.MoveFirst
    10.  
    11. Do Until MyRS.EOF
    12.   For Each tdf In CurrentDb.TableDefs
    13.     'Table exists, is Linked, and is not named tblLinkedTables
    14.     If tdf.Name = MyRS![Table Name] And Len(tdf.Connect) > 0 And tdf.Name <> "tblLinkedTables" Then
    15.       blnLinked = True: Exit For
    16.     Else
    17.       blnLinked = False
    18.     End If
    19.   Next
    20.     If blnLinked = False Then
    21.       DoCmd.TransferDatabase acLink, "Microsoft Access", strPathToData, acTable, MyRS![Table Name], MyRS![Table Name], False
    22.     End If
    23.     MyRS.MoveNext
    24. Loop
    25.  
    26. MyRS.Close
    27. Set MyRS = Nothing
Oct 22 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Andreas Lauffer | last post by:
I changed from Access97 to AccessXP and I have immense performance problems. Details: - Access XP MDB with Jet 4.0 ( no ADP-Project ) - Linked Tables to SQL-Server 2000 over ODBC I used...
1
by: Douglas Lane | last post by:
I would appreciate any help with this. At my wit's end. I have an access front end linking to SQL Server tables on the back end. One of these linked tables had a subdatasheet to another of the...
4
by: Neil Ginsberg | last post by:
I have ODBC linked tables to a SQL 7 database in an A2K database. The linked tables do not have the password stored in them, so the first time the user accesses them, they need to enter the SQL...
7
by: Joe | last post by:
I am using Access 2003 and are linking to an Oracle 9i ODBC datasource (using Oracle ODBC drivers). After linking the tables in Access, I inspect the data contained in the linked tables. For...
1
by: Thor_MN | last post by:
Has anyone run into this problem? I have a database that is used to create reports from one of three different "company/division" SQL Server databases. The startup form allows the user to pick...
15
by: brettclare | last post by:
I have linked a large SQL Server table to Access, however 'only' 2,195,439 records are shown and are available to query. Can I increase the size (cache??)/number of records showing in Access? ...
1
by: Julia | last post by:
Hello there. I have a question somewhat related to this topic, and I don't know where else to go. I hope somebody can help. I've created a database in access, that I'd like to share with less...
10
by: Jim Devenish | last post by:
I have a split front end/back end system. However I create a number of local tables to carry out certain operations. There is a tendency for the front end to bloat so I have set 'compact on...
1
by: Himmel | last post by:
Hello, I am using an access database to query a very large number of linked tables. Currently, the name of the database the linked tables point to is always the same name. However we are...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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...
0
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,...

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.