473,781 Members | 2,413 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Change the Database that a linked table references

21 New Member
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 switching to a new system that uses versioned databases. Each time a new build of the database is published, a whole new database is created.

For example, we are currently on version 1847. The linked tables are set to look in "Database_1847" .

A new build of the database is published as "Database_1848" . The linked tables are still set to read from "Database_1 847" which contains old data.

I have over 200 tables that need to be relinked to "Database_1 848" and I would prefer not having to delete them and reimport them. Is there a VB command or function that can be used to update the database all my linked tables are linked to?
Jun 29 '07 #1
1 3710
Himmel
21 New Member
Found it myself. :) In case anyone else wants to know how, here ya go. I go through ODBC so I've included the ODBC reference info. I believe you can leave it off, but I'd rather not chance it. :)

Expand|Select|Wrap|Line Numbers
  1. Dim db As DAO.TableDef
  2. Dim newbuild As String
  3.  
  4. newbuild = InputBox("Please enter the database build:")
  5.  
  6. For Each db In CurrentDb.TableDefs
  7. If Len(db.Connect) > 0 Then
  8.  
  9.     db.Connect = "ODBC;DSN=ODBC_DB_NAME;DATABASE=" & newbuild
  10.     db.RefreshLink
  11.     x = x + 1
  12.  
  13. End If
  14. Next
  15. MsgBox ("Update complete." & vbCrLf & vbCrLf & x & " tables have been updated to " & newbuild & ".")
  16.  
  17.  
Jun 29 '07 #2

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

Similar topics

2
2694
by: Robert McGregor | last post by:
Hi all, I've got a Front End / Back End database that was working just fine. One day i opened the FE to find that if I tried to open one of the linked tables from the database window, nothing happened (hourglass for about 2 seconds then nothing). I tried relinking the tables and got the same response. (Access even completely bombed out once with a Dr Watson failure).
1
4837
by: Ange T | last post by:
Hi, I have a secured Access 2000 database, and have encountered a strange error that I can't find any similar postings on. I'd really appreciate your help! In my database, I have a number of local tables as well as a number of linked tables. The User that I have logged in as ("Developer1") is the owner of all objects and is Administrator. In the User and Group Permissions box, under Change Owner, Developer1 is the current owner
4
3004
by: argniw | last post by:
I have a number of OBDC connections to SQL server tables in my access database. I want to change the data source for each of the links at once. With the linked table manager you can only change the source one link at a time. I will want to provide the user with a way to switch the data source from a form interface. How can this be accomplished?
7
7071
by: F. Michael Miller | last post by:
I have a db with Access front end, sql back, linked tables. I need to be able to change input masks at the table level in code. Any ideas? Thanks!
5
3683
by: Malcolm Webb | last post by:
Hello All, I had some considerable help from people in this forum a log while ago whilst developing a databse for use in our business. The database has developed beyond my wildest dreams over the last 3 years and I am very proud of it. It was developed in Access 2000 on a Windows 95 machine where it still runs and during the development process I added various elements from the installation disks which were not part of the standard...
3
2429
by: jbsfe | last post by:
I have "Spilt" my database and the "lookup" and "seek" methods that previously worked, no longer do. I have learnd from reviewing the posts that the "lookup" and "Seek" methods cannot be used on linked tables and that you cannot set an "index" for a linked table. What I don't know how to do, is revise my code to complete the same tasks as it it did before I split the database. I'm sure the problem lies is this block of code: 'Define...
4
1651
by: danthrom | last post by:
Hi, I have a database with four tables. tbl_Client client_alias (PK, text) tbl_Matters matterID (PK, autonumber) matter (text) client_alias (foreign key, tbl_Client)
8
2703
by: rdemyan via AccessMonster.com | last post by:
I've converted my application from A2K format to A2003 format. I tried to follow Allen Browne's protocol in getting my app into A2003 (although I was unable to find informtion on the conversion process). Lots of decompiling and lots of compacting of the original application in A2000. Then the app was opened in A2003 and compacted, decompiled and compacted. Next I imported everything into a blank A2003 database. Then this db was...
1
1895
by: STUFIX | last post by:
Hi, I need to change a field name in a table stored on a backend database that is used by various queries, forms, etc on the front end client via a linked table. I can't work out how to change the name in the b/e without having to change all the individual references to it in the f/e. I haveauto name correct turned on in both f/e and b/e but I guess these are not related to each other. Any suggestions please?
0
9474
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
10308
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
10143
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...
1
10076
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,...
0
9939
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
8964
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7486
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6729
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();...
3
2870
bsmnconsultancy
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...

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.