Breaking and reestablishing relationships

T

tcb

Is the relationship between two tables an object that can be
maniuplated in code? Setting referential integrity, relationship type,
cascading deletes and such?

I'd like to break the relationship to several tables, import records,
then reset the relationships (one to many).

tblCourse --> tblCourseDetail

tblCourse <-- tblAgency
 
M

MacDermott

While this can be done, it's rarely a wise approach.
Usually it's enough to import into the "master" table first, then the child
table.
If there are items in the data to be imported, which you don't want to keep
because they break referential integrity, I'd suggest importing to a
temporary table and using a query to identify those items.
 
T

tcb

The way the database was set up, there is a one-many relationship
between tblCourse (master) and tblCourseDetail (child).

There is a one to many from tblAgency (master) to tblCourse (child).

In one case tblCourse is the master and in the other, the child, which
creates the dilemma.

How is the relationship object referred to in VB?
 
M

MacDermott

I don't see a problem -
Import your tables in this order:
tblAgency
tblCourse
tblCourseDetail
 
T

tcb

I'm no good at chess either.

Initially I was getting "records not imported" type errors which had I
looked closer were not key violations. The developer had added
validation rules to the new tables.

Nonetheless I still missed what will be forever obvious now.

Thanks.
 

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