Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2005
    Posts
    46

    Unanswered: Relationships or Lookups

    I have created a Database which stores data of Printers and PC's which have reserved IPs on the DHCP server. I will tell you some details first:

    There are 2 tables:
    Table1 Main

    Name
    MAC
    IP

    Table2 Switch

    Mac
    Swith
    Port

    Some things to note:
    1.There can be only one mac on any given switch/port at a single time
    2.You can have duplicate printers with different names ie payroll and admin, that have the same MAC and IP .
    3.There can be only one IP reserved for one MAC address

    Example Data
    Table:Main
    Printer1
    MAC001
    IP192

    Table:Main
    Printer2
    MAC001
    IP192

    Tablewitch
    MAC001
    Switch1
    Port1

    Problem
    If you had to change the mac or IP for one of the printer, you will need to update the other printers which use that MAC or IP plus update the MAC on the switch

    My question to you guys is this:
    How do I this, I have no relationships in the database so far I have been using subform and lookups to display the data but now I need to do this, can any one help me?

  2. #2
    Join Date
    Apr 2004
    Location
    outside the rim
    Posts
    1,011
    hmmm, sounds like you need to carefully layout how you need this to be structured. In relationships, there is something called "referential integrity" which enforces the rule that child records must have a parent. Along with this is the option of cascading updates and cascading deletes. Base don what I think you are looking for, these will do what you are looking for.

    Another approach would be to use code that opens recordset (or queries) to check and update the information. This can be bulky to setup, especially in a multi-user environment, but gives you control over the process (there are instances whare referential integrity can be annoying, problematic and a serious pain in the neck).

    Try the first option (in a copy of your database) and see if that solves your problem. If it does, you just saved a bunch of wok.

    tc

  3. #3
    Join Date
    Oct 2004
    Location
    Oxfordshire, UK
    Posts
    89
    But maintaining relationships is easier than maintaing code or queries especially in a development environment... You need to: identify your data objects (unique entities); create tables based on those with the correct indexes; and then create relations between those tables. Sorry I can't be more specific, but I'm uncertain what those entities might be.
    Last edited by MyNewFlavour; 08-23-06 at 06:47.

Posting Permissions

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