Results 1 to 3 of 3
  1. #1
    Join Date
    Sep 2014
    Posts
    2

    Compound_key

    It may be that there is no unique column in a database. Then it will not be possible to create a Primary key based on a single column.

    In that situation a COMPOUND KEY has to be prepared by combining two or more columns.

    My question is how this COMPOUND KEY is prepared. Kindly provide me the path or process.



    Regards,
    Somnath

  2. #2
    qa12dx is offline Competent Performer
    Windows 7 64bit Access 2007
    Join Date
    Nov 2012
    Location
    india
    Posts
    112
    in the table design view, select/highlight all the fields you want to use. if they are not sequential, use ctrl and click. then click primary key.

    save the table. if the fields are truely uniquie in the combination, it will save, else it will give you and error.

    helps if the tables dont have much data. also, if you want to clean up dups. do a copy paste of the table, structure only. choose and make ur pks. append data into the table. all dups will auto not get appended. rename original table to tbl_xxx_backup. now, rename ur new table to the same

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,644
    Can use an autonumber field as PK. A compound index can be set without making it the PK. The autonumber value will be saved as FK in related tables. http://office.microsoft.com/en-us/ac...010210347.aspx
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

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