+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Forum Contributor
    Join Date
    03-12-2004
    Posts
    147

    Do I need to have a Key?

    I am not exactly clear what a Primary Key does, I mean, I know what it is, but I guess I don't grasp the importance of defining a Key all the time.

    I am buidling my first access based database and so far have 5 tables. The first four tables have an obvious Key, the fifth does not.

    The fifth table is the largest of the set - while the others are more-or-less static tables that will be between 10 - 500 rows, the fifth table grows by about 200 records per day.

    Technically the key would be the combination of the first 5 columns in the table (user ID, Date, Activity, Sub Activity, Category) but there are only 8 columns total.

    Should I go ahead and assign the key to those 5 fields? Would it be better to add an autonumber Key instead?

    Appreciate the advice, thanks

  2. #2
    Forum Moderator ConneXionLost's Avatar
    Join Date
    03-11-2009
    Location
    Victoria, Canada
    MS-Off Ver
    2003 & 2010
    Posts
    1,797

    Re: Do I need to have a Key?

    Hi shadestreet,

    Building a "compound" primary key as you suggest is quite possible, but you should acknowledge a limit in the number of components to that key (five is probably a bit much). You'll discover that an autonumber primary key for that table will pay off with convenience once you start writing queries to this table.

    Cheers,
    Docendo discimus.

    Please consider:
    • Thanking those who helped you. Click the reputation icon in the contributor's post and add Reputation.
    • Cleaning up when you're done. Mark your thread [SOLVED] if you received your answer.

  3. #3
    Forum Contributor
    Join Date
    03-12-2004
    Posts
    147

    Re: Do I need to have a Key?

    Thank you for the feedback, if you or anyone doesn't mind, I would appreciate a bit of a lesson on why the autonumber will be helpful to me in the future?

    I can't see every using it in a meaningful way when I query.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.2.0