Results 1 to 4 of 4

Thread: adox, creating tables, how to set autonumbering RESOLVED

  1. #1

    Thread Starter
    Addicted Member c@lle's Avatar
    Join Date
    Oct 1999
    Location
    Belgium
    Posts
    179

    adox, creating tables, how to set autonumbering RESOLVED

    hello,
    i'm creating tables in an access database via ADOX.

    i can create the tables, add fields to it (eg. integer, varchar, ...) , but now i want an autonumbering field.

    how can i do this?
    Last edited by c@lle; Oct 29th, 2001 at 09:46 AM.

  2. #2
    Fanatic Member
    Join Date
    Aug 2001
    Location
    Connecticut
    Posts
    855
    ' Create a new autonumber ID Column
    Set col = New ADOX.Column
    col.Name = "theColName"
    col.Type = adInteger
    col.ParentCatalog = cat 'cat is the catalog variable
    col.Properties("Autoincrement") = True
    cat.Tables("theTableName").Columns.Append col
    VB 6.0, Access, Sql server, Asp

  3. #3
    -= B u g S l a y e r =- peet's Avatar
    Join Date
    Aug 2000
    Posts
    9,629
    or u can use SQL ...

    VB Code:
    1. SQL = "ALTER TABLE Table1 ADD COLUMN ID COUNTER"
    2. cnn.Execute SQL
    -= a peet post =-

  4. #4

    Thread Starter
    Addicted Member c@lle's Avatar
    Join Date
    Oct 1999
    Location
    Belgium
    Posts
    179
    thanks.

Posting Permissions

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



Click Here to Expand Forum to Full Width