Results 1 to 6 of 6

Thread: Auto Number

  1. #1
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Unanswered: Auto Number

    Hello there,
    does anyone know how to add an Auto Number using the Alter Table someting like that

    currentdb.Execute "ALTER TABLE Records ADD column id Long integer"

    That creates a field called id in the table Records but not filled with the auto numbers.....

  2. #2
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Hammy ...

    Use the COUNTER type. It translates to AutoNumber ...
    Back to Access ... ADO is not the way to go for speed ...

  3. #3
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    AUTOINCREMENT is the field type you want...

    "ALTER TABLE Records ADD COLUMN id AUTOINCREMENT"



    Edit: hah! I guess COUNTER works too...
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  4. #4
    Join Date
    Sep 2003
    Location
    MI
    Posts
    3,713
    Quote Originally Posted by Teddy
    AUTOINCREMENT is the field type you want...

    "ALTER TABLE Records ADD COLUMN id AUTOINCREMENT"



    Edit: hah! I guess COUNTER works too...
    I don't have that one in my 2002 VB handbook ... What version(s) does AUTOINCREMENT start in Ted?
    Back to Access ... ADO is not the way to go for speed ...

  5. #5
    Join Date
    Mar 2003
    Location
    The Bottom of The Barrel
    Posts
    6,102
    Provided Answers: 1
    Dunno... It's been present since at least 2000 since it's in the JET 4.0 reserved word list, but I have no idea when it was originally implemented.
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

  6. #6
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Thank you M Owen and Teddy, both of your suggestions functioned.
    Thanks again...

Posting Permissions

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