Welcome to SPN

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

Sign Up Now!

Adding auto-numbered Primary Key to imported tables.

Discussion in 'Information Technology' started by vikenk@aol.com, Jul 28, 2006.

  1. vikenk@aol.com

    vikenk@aol.com
    Expand Collapse
    Guest

    Hello,

    I'm working on a project with a friend. He has an old dBase III
    database he wants to convert to Access. It's mostly names and addresses
    for a mailing list for a newsletter. Importing the table was no
    problem. My problem is that I'd like to assign an Auto-Numbered Primary
    Key to the table, but Access 2003 won't let me.

    How can I import the data and provide an auto-numbered Primary Key as
    well? Access won't let me use an auto-numbered key.

    I've tried to create a new table with a primary key then tried to
    import the data into the table, hoping that it would automatically auto
    number it, but it only imports the table as a whole, not just the data
    within the table.

    For some background: I've created databases before (mostly mailing
    lists with sorting filters, etc) and my knowledge of Access falls
    somewhere between beginner and intermediate (closer to intermediate),
    but I have no SQL or VBScript knowledge.

    Any ideas?

    --
    Viken K.
    http://www.vikenk.com
     
  2. Jeff C

    Jeff C
    Expand Collapse
    Guest

    Once you have imported your table go to design view, add field [ID] data type
    auto number. Save the table. Then select that field again in design mode
    and make it a primary key, then save the table.
    --
    Jeff C
    Live Well .. Be Happy In All You Do


    "vikenk@aol.com" wrote:

    > Hello,
    >
    > I'm working on a project with a friend. He has an old dBase III
    > database he wants to convert to Access. It's mostly names and addresses
    > for a mailing list for a newsletter. Importing the table was no
    > problem. My problem is that I'd like to assign an Auto-Numbered Primary
    > Key to the table, but Access 2003 won't let me.
    >
    > How can I import the data and provide an auto-numbered Primary Key as
    > well? Access won't let me use an auto-numbered key.
    >
    > I've tried to create a new table with a primary key then tried to
    > import the data into the table, hoping that it would automatically auto
    > number it, but it only imports the table as a whole, not just the data
    > within the table.
    >
    > For some background: I've created databases before (mostly mailing
    > lists with sorting filters, etc) and my knowledge of Access falls
    > somewhere between beginner and intermediate (closer to intermediate),
    > but I have no SQL or VBScript knowledge.
    >
    > Any ideas?
    >
    > --
    > Viken K.
    > http://www.vikenk.com
    >
    >
     
  3. vikenk@aol.com

    vikenk@aol.com
    Expand Collapse
    Guest

    Jeff C wrote:
    > Once you have imported your table go to design view, add field [ID] data type
    > auto number. Save the table. Then select that field again in design mode
    > and make it a primary key, then save the table.


    Jeff,

    Thank you very much. It worked like a charm! :>) Still though, I
    wonder why Access didn't allow me to do it before...

    --
    Viken K.
    http://www.vikenk.com
     
  4. Jeff C

    Jeff C
    Expand Collapse
    Guest

    Creating an autonumber field is unique. When you create an autonumber field
    it automatically numbers each record as soon as you save it. Making the
    field a primary key is yet another action requiriing the program to verify
    the uniqueness if each record. Access just requires the step by step process.


    --
    Jeff C
    Live Well .. Be Happy In All You Do


    "vikenk@aol.com" wrote:

    >
    > Jeff C wrote:
    > > Once you have imported your table go to design view, add field [ID] data type
    > > auto number. Save the table. Then select that field again in design mode
    > > and make it a primary key, then save the table.

    >
    > Jeff,
    >
    > Thank you very much. It worked like a charm! :>) Still though, I
    > wonder why Access didn't allow me to do it before...
    >
    > --
    > Viken K.
    > http://www.vikenk.com
    >
    >
     

Share This Page