[dba-Tech] Importing data into Access and creating primary and foreign keys
Susan Harkins
ssharkins at gmail.com
Sat Aug 4 08:16:30 CDT 2018
Here's the setup: We're moving Excel data (so no pk/fk values or
relationships) to Access. The db has five tables: one parent, one child, two
lookups, and an associate between the parent and child to support a mtm
relationship.
This will be a small db that tracks memberships. Memberships is the parent;
members is the child. Each membership can have more than one member and each
member can have more than one membership -- hence the mtm. All values belong
to the individual membership and are stored in that table. The child
(members) table stores only member names the PK, and a FK to the memberships
table.
Appending records into the parent table and generating pks for each record
is no problem. Appending records into the child table and generating pks for
each record is no problem. However, how do I get the PKs from the parent and
child tables into the associate table as FKs?
It's not so big that we couldn't enter the members manually, but it seems
like we shouldn't have to.
Any help would be appreciated. I used to know how to do get the FK values
into a child table, but I have forgotten -- I don't work with Access
anymore. I actually wrote about it, but that was ages ago and I can't find
the article. However, I'm sure I never had the experience with a mtm, only
one to many.
Susan H.
More information about the dba-Tech
mailing list