Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jul 2002
    Location
    The sunny side of the Alps
    Posts
    230
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Add AutoNumber column in Access

    hI!

    Does anybody know hot to add AutoNumber column with SQL "Alter Table" or "Create Table" statement (for Access). I've been looking around, but haven't found the solution.

    Thanks,
    Bostjan
    Last edited by bostjank; 01-27-2003 at 02:00 PM.

  • #2
    Senior Coder
    Join Date
    Jun 2002
    Location
    Zwolle, The Netherlands
    Posts
    1,120
    Thanks
    2
    Thanked 31 Times in 31 Posts
    ALTER TABLE tablename ADD COLUMN columnname COUNTER

    The counter datatype indicates an autonumber field
    I am the luckiest man in the world

  • #3
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Didn't know that - I know when creating tables in access that autoincrement works. Does this also work when adding the field on the fly?
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)


  •  

    Posting Permissions

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