Results 1 to 9 of 9
  1. #1
    Join Date
    Nov 2004
    Posts
    90

    Unanswered: link table ASAP...

    dear all members,

    can I link two table without any primary key? my problem is I can't relate two table with has no primary key. Any suggestion is fully appreciated.

  2. #2
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    What are you trying to do?

    Do you want all data from both tables in a single table, are tehy in the same style i.e. all the data you want is containes in both tables
    You could then use a UNION Query

    How are the tables meaant to be joined etc.

    Dave

  3. #3
    Join Date
    Nov 2004
    Posts
    90
    the main objective is I can't retrieve the data from the table (master recrod) when I key in data related to that table that link each other.

    for example : table A, table B (master record) - related each other with no primary key assigned.

    when I enter the data from field name table A, then the other record related with that number in table B will appear. So any suggestion is fully appreciated.

  4. #4
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by oasislah
    the main objective is I can't retrieve the data from the table (master recrod) when I key in data related to that table that link each other.

    for example : table A, table B (master record) - related each other with no primary key assigned.

    when I enter the data from field name table A, then the other record related with that number in table B will appear. So any suggestion is fully appreciated.
    Hi Oasislah,

    In my own opinion it is best to set a PrimaryKey in both tables and then set the ForeignKey in one table to set your relationships. That really should be the basis of how you set up your tables in a RelationalDatabase system. I may be wrong and you can do it a different way, but I think you will be making more work of a simple task. If your relationships are setup correctly in the beginning, then relating tables is really easy work. Just my thoughts on your situation.

    have a nice day,
    Bud
    and again Welcome to the Forum.

  5. #5
    Join Date
    Jan 2004
    Location
    Aberdeen, Scotland
    Posts
    1,067
    Are the 2 tables got anything in common if one of the tables is just a list of things that can be inserted into the other table a simple select should do it.

    i.e.
    SELECT B.*
    FROM B LEFT JOIN A
    ON B.1 = A.1

    That will work if its a one to one or one to many join
    If its Many to Many you may struggle

  6. #6
    Join Date
    Nov 2004
    Posts
    90
    thanks for you both to help me...

    In my case, I tried assigned them with primary key and foreign key coz they are the basis of relational DB. But, the result is still can't to get the result. the problem is regarding referencial integrity. But after I try to make sure all related field name in the same index, its still told my thats problem. I think maybe the record database dont match with the related. So for your suggestion maybe very helpful..and I hope so...coz my taks to complete it is very urgent now

  7. #7
    Join Date
    Nov 2004
    Posts
    90
    for my members,

    my case of relation is many to many relationship. So how many kinds of number in one field can retrieve the data in related field the other table (also many to many record)??

    thank you very much 4 any suggestion.
    Last edited by oasislah; 11-02-04 at 05:34.

  8. #8
    Join Date
    Nov 2004
    Posts
    90
    Can I ask something? Could I attacth my sample of table for more easier understanding?

  9. #9
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004
    Quote Originally Posted by oasislah
    Can I ask something? Could I attacth my sample of table for more easier understanding?
    YES oasislah,

    That would help a great deal in getting someone to better help you. Remember to remove all pertinent data and replace with dummy data. Then let us know just how it SHOULD work. Maybe we can then help you out.
    Make a COPY of your database and then Zip it with WinZip or something. Then Attach here in the forum and that's it.

    Bud

Posting Permissions

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