CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Resetting a auto incr. field

    Hi Gurus,

    In a mdb, there is a table with auto-incrementing field. During my tests and trials, recs were added, deleted etc, and this field value is now some 300+.
    I want to deploy the DB into client's machine, and i have made a "distribution DB" with no records, just the bare table structure. I want to reset this auto incr field also to zero, so that when he adds recs it starts with 1.
    How do i do it?

    VB 5.0, DAO 3.5, Access DB.

    As an aside, how do people distribute databases?
    DO their setup programs create DB on the run? or copy a no-record sample DB like i am trying? What is the best method?

    RK

  2. #2
    Join Date
    Oct 1999
    Location
    CA
    Posts
    91

    Re: Resetting a auto incr. field

    It's not possible to reset an auto-increment field, but you could copy and paste the table's structure if you just want a blank table.

    As for distributing databases... The company I work for uses a runtime version of Access to distribute their mdb files. It comes with it's own setup program, which installs the database and the nessary files for the runtime access exe.

    Brewguru99

  3. #3
    Join Date
    Sep 1999
    Posts
    202

    Re: Resetting a auto incr. field

    Delete all records, and do a CompactDatabase.


  4. #4
    Join Date
    May 1999
    Location
    Omika, Japan
    Posts
    729

    Re: Resetting a auto incr. field

    Wow!. Great!.. it works.
    It was easy to implement!, as i had already deleted all recs and was getting ready for incl. in setup list..

    RK

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