Click to See Complete Forum and Search --> : Resetting a auto incr. field


Ravi Kiran
October 20th, 1999, 09:07 PM
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

BrewGuru99
October 20th, 1999, 09:44 PM
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

Bruno
October 21st, 1999, 12:47 AM
Delete all records, and do a CompactDatabase.

Ravi Kiran
October 21st, 1999, 03:14 AM
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