Results 1 to 8 of 8
  1. #1
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    239

    One to many relationship - neccessary ??

    Hi,



    Is always neccessary to link two tables with relationships ?

    Example: let's say I have table "Books" with all book data (Title etc.), and another table "Author" with all data about book author (Name etc.).

    I can store information about Author in 1st table even without linking tables - I can just change number field from 1st table to Combobox, and set It's control source to ID of 2nd table - and Combobox has view to data from 2nd table.

    Is there any difference If I create relationship between tables ??

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,549
    you don't have to for this example of Title-Author.
    You DO for parent-child relationships, like a purchase tORDER table - tOrderITems tbl
    the order is the parent, and the items bought are child. IF you delete the orderID record in tORder, the relationship prevents the deletion because it has children.
    If the parent got deleted , there would be orphan children records and no way to determine what the parent was.
    Its a save guard for just this.

    Books-Author is more of a many-many lookup to each other.

  3. #3
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848
    How do you handle a book co-authored by 2 or more people?

    If you don't understand relational database and relationships, here is a quick reference.
    If you're interested in relational database and wish to learn more concepts, then I recommend the 8 part youtube series on database by Dr. Daniel Soper that starts here.

    If you do understand and choose not to use them, then I suggest you work with a spreadsheet program (Excel).

  4. #4
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    239
    Ok,

    so I was right. It's just a safer solution to do with relationships, regarding deletions or records. So I will just stick to this, always.

  5. #5
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    239
    Orange,

    thanks for response, but I understand principles a little bit. I was just wondering If there is some major difference in DB behavior when you're just doing view to another table without linking them.

  6. #6
    orange's Avatar
    orange is offline Moderator
    Windows 8 Access 2010 32bit
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,848

  7. #7
    Lukael is offline Competent Performer
    Windows 7 64bit Access 2010 64bit
    Join Date
    Oct 2013
    Posts
    239
    I suggest you watch Dr. Soper's 1,2 and 4 videos and see if that helps.
    Thanks, I'll watch all videos, I'm sure there is something useful for me.

  8. #8
    ddcessex is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Jan 2016
    Posts
    4
    You do not have to relate any tables within an Access database.
    However, if you adopt this approach then you are responsible for the referential integrity of the records in each table.
    For example, If you delete a customer record then you are responsible for programatically checking that there are no orders logged against that customer.
    Were you to ignore this then your database will become populated with "Orphan" records (child records that no longer point to a parent) thereby destroying the integrity of your database.
    Setting up relationships within your database allows you to leverage the "built-in" referential integrity procedures within Access. If you then allowed users to delete a customer record, Access itself would check for child records before permitting the deletion to be executed. One can see that the latter option greatly reduces the programmers responsibility and commitment to developing code to maintain the integrity of the database.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 3
    Last Post: 03-19-2015, 05:26 PM
  2. Replies: 1
    Last Post: 12-06-2014, 12:49 PM
  3. Help with a One to Many relationship
    By ByronSmith3 in forum Database Design
    Replies: 4
    Last Post: 09-13-2014, 04:30 PM
  4. HR Relationship
    By trburgess in forum Database Design
    Replies: 5
    Last Post: 02-01-2012, 06:47 AM
  5. Relationship
    By Navop in forum Database Design
    Replies: 1
    Last Post: 01-16-2012, 02:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums