Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!

Set a field as a primary key.

Discussion in 'Information Technology' started by mohd21uk via AccessMonster.com, Jul 28, 2006.

  1. mohd21uk via AccessMonster.com

    Guest

    I have created a table called Status with a field called Status. I would like
    to set the field Status as a Primary Key and I would like this to be done
    progmatically. I would be grateful if you could provide me code that would do
    this.

    Many Thanks

    --
    Message posted via AccessMonster.com
    http://www.accessmonster.com/Uwe/Forums.aspx/access/200606/1
     
  2. Loading...

    Similar Threads Forum Date
    Sikh News Settlement Leads To Peaceful Transition At Sikh Temple Breaking News Sep 10, 2016
    Sikhi Langar-Aid - Sikhs Have Set Up A 'Langar' In The ISIS Territory of Syria To Feed Refugees Sikh Sikhi Sikhism Oct 31, 2015
    A set back or a step forward Blogs Oct 17, 2015
    USA Sikh Cartoonist Sets Out To Fight Racial Bias Breaking News Mar 9, 2015
    India Who says we have skeletons only in our closets? Breaking News Aug 22, 2014

  3. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    Using ADO ...

    CurrentProject.Connection.Execute "ALTER TABLE Status ADD CONSTRAINT
    PrimaryKey PRIMARY KEY (Status)"

    Using DAO ...

    CurrentDb.Execute "ALTER TABLE Status ADD CONSTRAINT PrimaryKey PRIMARY KEY
    (Status)"

    See the 'ALTER TABLE' and 'CONSTRAINT Clause' topics in the help files for
    more information.

    --
    Brendan Reynolds
    Access MVP

    "mohd21uk via AccessMonster.com" <u20517@uwe> wrote in message
    news:620ce3d35c350@uwe...
    >I have created a table called Status with a field called Status. I would
    >like
    > to set the field Status as a Primary Key and I would like this to be done
    > progmatically. I would be grateful if you could provide me code that would
    > do
    > this.
    >
    > Many Thanks
    >
    > --
    > Message posted via AccessMonster.com
    > http://www.accessmonster.com/Uwe/Forums.aspx/access/200606/1
     

Share This Page