Welcome to SPN

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

Sign Up Now!
  1.   Become a Supporter    ::   Make a Contribution   
    Target (Recurring Monthly): $200 :: Achieved: $98

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
    >
    >
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page