+ Reply to Thread
Results 1 to 2 of 2

Make table with primary and possibly Referential integrity?

  1. #1
    Registered User
    Join Date
    02-26-2009
    Location
    India
    MS-Off Ver
    Access
    Posts
    46

    Make table with primary and possibly Referential integrity?

    Hi all!

    I'm probably way off base here but I've been using access for about a month and have read some books to ease the pain and from time to time I hit a roadblock.

    My problem:
    I have a backend database that creates a make table query from an odbc. This has to be updated regularly as it has information such as employee id's, names, leave status, terms, etc. I use the table that is created from the make query (Hierarchy) and use it with a (Training) table which has training info (such as location, trainer, course number) and a third table (AgentTraining) that associates the primary keys from the "Hierarchy" table and "Training" table.

    I need the relationship for when an employee is termed it will delete all records instead of me having to hunt down orphaned records. I've also built some form objects that (cascading combo's and such) I believe depend on these relationships. As right now everything works but the make query due to relationships.

    To show how this is set up:
    Table Hierarchy with PK AGENT_ID is tied to AgentTraining FK AGENTID I'll leave the association of other table out as I don't think it's necessary for this explanation.

    Since I'm still a novice I didn't realize I couldn't do a make table with relationships so I'm at an dead end. I have been deleting the relationship between "Hierarchy" and "AgentTraining" and running the make table query on my backend, running a query to find the orphaned records in my main db then re-establishing the relationships.

    So I was wondering if maybe I could somehow bypass the restriction with relationships and doing a make query or if I could possibly put some type of constraint code into my make to work outside the box. At this point I'm open to suggestions.

    Here's my SQL code for the make query:

    Please Login or Register  to view this content.
    and specific help would be appreciated as I started learning VBA and SQL three weeks ago.

  2. #2
    Forum Administrator ExlGuru's Avatar
    Join Date
    03-17-2009
    Location
    India
    MS-Off Ver
    2003,2007
    Posts
    222

    Re: Make table with primary and possibly Referential integrity?

    Can I ask why you're doing a make table query, rather than an append query? I may be misunderstanding what you're doing, but thought I'd ask just to make sure.
    ExlGuru

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1