Results 1 to 4 of 4

Thread: linking data

  1. #1
    Join Date
    Feb 2006
    Posts
    3

    Red face Unanswered: linking data

    Hello

    I am really hoping that somebody can help me

    i am trying to write a smiple database with 6 small tables in and then somehow link them so that i can do queries etc.

    so far i have found out that i can not have all hte primary keys in a table as i keep getting a message saying duplicate data, which is what i want!!

    i have come across relationships but don't think that i have done the right thing with them

    i am really at my wits end here, so i hope soembody out there can help me, please

  2. #2
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    Can you post an example of what a few of your tables contain, and which field you think should be the primary key?

    Like:

    tblCultomer
    -----------
    fldCustID PrimaryKey
    fldCustName
    fldCustAddress

    tblOrder
    --------
    fldOrderID PrimaryKey
    fldCustID
    fldItem
    fldQty

    fldCustID in tblOrder would link to the fldCustID in tblCustomer.
    Inspiration Through Fermentation

  3. #3
    Join Date
    Feb 2006
    Posts
    3
    okay, will do

    tableDriver

    DriverID primary Key
    surname
    firstname
    (etc)
    ManagersID
    managersSurname
    ManagersFirstname


    tableInsurance

    InsuranceCompanyID primaey key
    name
    Address etc

    table Manintence company

    maintenceCoID Primary Key
    frim name etc

    and a table for the recovery agency and garage, things like that, then there is a large table with all hte stuff in it about the lorries themsleves

    talbe lorry
    RegNo PrimaryKey
    size
    leaseout
    no of crew

    and tonnes of other things to do wiht the lorry

    but i want to be able to run queries to show things like the insurance company of that particular lorry,who drives it and age, etc, those sort of things

    i have tried putting in hte same field names, it lets me do that, but not fill in hte details

  4. #4
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941
    From the schemas you've posted, I see no relationships between those tables.

    If you want to relate tableLorry to table insurance, you must put an
    insurancecompanyID field in tableLorry, but do not make it a
    primary key in tableLorry. That will allow you to have many lorries with the same insurance company.
    Inspiration Through Fermentation

Posting Permissions

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