473,320 Members | 1,820 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,320 software developers and data experts.

How do I delink tables

I have a copy of a database that has linked tables. Is there any code that will allow me to delink all of the tables at once, so that I can add test improvements to the data base with out corrupting or adding erroneous data that might confuse other users of the orginal database
Sep 22 '11 #1
4 5925
Seth Schrock
2,965 Expert 2GB
You can do a one-time de-link by copying the tables and then pasting them into your testing database. When you paste them in, it gives you the option to paste design only, design & data, or append the data. In your case you would probably want the design & data option. It will ask you the question for every table that it is pasting. This works in Access 2010. I've never tried it in previous versions however.

As far as code that you could run, I don't have any idea.
Sep 22 '11 #2
ADezii
8,834 Expert 8TB
I created some Generic Code for you that will Delete the Links (Delink) to all Externally Linked Tables, then give back a Count of how many Links were Deleted. The Key to making this work is to check the length of each Tables Connect Property. Native Tables will not have a Value for this Property, whereas Linked Tables will. Only the Links themselves are deleted, and not the External Tables.
Expand|Select|Wrap|Line Numbers
  1. Dim tdf As DAO.TableDef
  2. Dim intCtr As Integer
  3.  
  4. With CurrentDb
  5.   For Each tdf In .TableDefs
  6.     If Len(tdf.Connect) > 0 Then
  7.       intCtr = intCtr + 1
  8.         .TableDefs.Delete tdf.name
  9.     End If
  10. Next
  11. End With
  12.  
  13. MsgBox intCtr & " Table Links have been DELETED", vbCritical, "Delete Table Links"
Sep 22 '11 #3
Rabbit
12,516 Expert Mod 8TB
I believe what the OP actually wants is to "unlink" the tables but keep the data. In which case, don't forget to import all the tables from the back end into the database after deleting the links. Or alternatively, copy the backend, rename it, and relink the front end to the snapshot of the backend.
Sep 22 '11 #4
ADezii
8,834 Expert 8TB
@Rabbit: Thanks for clearing that up, totally missed it! (LOL).
Sep 22 '11 #5

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

Similar topics

6
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...
44
by: Mariusz Jedrzejewski | last post by:
Hi, I'll be very grateful if somebody can explain me why my Opera 7.23 (runing under linux) doesn't show me inner tables. Using below code I can see only "inner table 1". There is no problem with...
4
by: serge | last post by:
I tried all the INFORMATION_SCHEMA on SQL 2000 and I see that the system tables hold pretty much everything I am interested in: Objects names (columns, functions, stored procedures, ...) stored...
3
by: Random Person | last post by:
Does anyone know how to use VBA to relink tables between two MS Access databases? We have two databases, one with VBA code and the other with data tables. The tables are referenced by linked...
11
by: dskillingstad | last post by:
I've been struggling with this problem for some time and have tried multiple solutions with no luck. Let me start with, I'm a novice at Access and I'm not looking for someones help to design my...
59
by: phil-news-nospam | last post by:
In followups by Brian O'Connor (ironcorona) to other posts, he repeats the idea that using tables in CSS is not something that should be done because IE doesn't support it. Of course I'm not happy...
5
by: rdemyan via AccessMonster.com | last post by:
I have a need to add another field to all of my tables (over 150). Not data, but an actual field. Can I code this somehow. So the code presumabley would loop through all the tables, open each...
4
by: db2admin | last post by:
Hello, I want to plan rearranging tables in our database according to business areas. say all tables in business area A will be in seperate tablespace or tablespaces. I am planning to monitor...
25
by: bubbles | last post by:
Using Access 2003 front-end, with SQL Server 2005 backend. I need to make the front-end application automatically refresh the linked SQL Server tables. New tables will be added dynamically in...
1
by: matthewra | last post by:
I have table: tblProj Proj_ID Proj_Name I have table tblOrg Org_ID Org_Name I have table linkProjOrgtable which is to link 1 or more orgs to a project linkProjOrg_ID key)
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.