Copy Relationships between databases

B

Beverly Darvill

I have 2 databases - one live and one test - I want to copy the relationships
from the test database into the live database without having to recreate all
the links again.

Is this possible?

Thanks

Beverly
 
C

Clifford Bass

Hi Beverly,

I am not sure how others deal with this, but this is what I do:

In the test (development) database that contains modified tables I
create temporary links to all of the tables in the production database and
name them something like "tblzzOriginal_Name_Old". I then create a bunch of
temporary queries that empty out all of the tables in the test database and
another bunch of temporary queries that use the linked tables to reload the
new/modified tables. When I am ready to do the upgrade I run the queries to
get the current data into the test database, then delete the links to the old
tables and delete the temporary queries, then do a compact and repair and
then copy the test database to the production location. New relations will
of course exist in the new production database because it is a copy of the
test database. Note that this works for a single customer upgrade. If you
have multiple customers, you will either have to come up with another
solution or repeat the process for each.

As an alternative, you can use SQL to modify existing tables and to
create relationships. Do a search in Access's online help for "alter table".
Or you probably can use the CurrentDB.Relations collection. I have not used
that so am not able to give specifics. Do a search in help for "relations
collection". With that you could open up both test and production databases
in code and loop through the collections in each database,
adding/updating/deleting in the production database as needed.

As a reminder, make sure to make backups of your production databases
before attempting the changes.

Hope that helps,

Clifford Bass
 
P

Paul Shapiro

Look at the DAO relationships collection. You can write code to read the
collection from your test db and create the same relationships in the live
db. You can also buy modeling tools that may automate the process for you,
but they're generally expensive if cost is an issue.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top