Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to replace data, without losing the relationships?

Status
Not open for further replies.

Archmike

MIS
Nov 25, 2003
3
ZA
Hi

Sorry but this is a basic question. I need to update my tables from another (bigger) ACCESS database with new and existing info, every day. How do I do this without losing the relationships and primary key? Every time I do it, the relationships are broken, primary key is gone.

Thanks for your help

Mike
 
Can you not just take your data from the main database?
Use queries as a substitute for tables so you only retrieve the data you need to access?

John
 
I tried it, and it the following problems occur:

a) I need a table to be formed in my second database because other tables are built from it.
b) The primary key is lost with the query


There must be a way of simply replacing the dat in an existing table with new data?!!

Thanks though

M
 
In that case I would use a delete query to remove the existing data, then an Insert query to transfer the data.

John
 
Thanks for the help, in the end, your advice was right. It works as follows:
before I want to update the data, I delete the current info from the table, then remove the primary keys, then append the new data and lastly replace the primary keys again.

Very cool for a baby-programmer like me.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top