CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2001
    Posts
    19

    seeding access autoincrement

    hiya,
    anyone know how to seed an autoincrement field to start at any given value.
    Code so far is

    set SolTd = NewDb.CreateTableDef("sol")

    With SolTd
    .Fields.Append .CreateField("ID", dbLong)
    set NewFld = .Fields("ID")
    NewFld.Attributes = DB_AUTOINCRFIELD
    End With




    thanx
    mat



  2. #2
    Join Date
    May 2000
    Location
    New York, NY, USA
    Posts
    2,878

    Re: seeding access autoincrement

    set ref to ADOX
    this code will create a new autoincrement field

    Set col = New ADOX.Column
    Set col.ParentCatalog = cat
    With col
    .Type = adInteger
    .Name = "ID"
    .Properties("Autoincrement") = True
    End With
    tbl.Columns.Append col

    after that I think you can deal with this field as with any other one, i.e. enter any value.

    Iouri Boutchkine
    [email protected]
    Iouri Boutchkine
    [email protected]

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

Featured