Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to reset and duplicate an entire database

Status
Not open for further replies.

amigo02

Programmer
Feb 19, 2003
109
I have an ms access database with about 60 tables in it and each and every table has an autonumber field and offcourse I have alot of data in those tables too.

I would like to reset the database and auto number fields to 0 and hava fresh copy of the database without any data in it..

Is there an easy way to do it?
 
I think if you truncate (Delete) all the data from all the tables and then do a Compact and Repair on the database it will reset the autonumber...

Personally, I try to limit my use of Autonumber fields. I've had issues in the past where autonumber was not properly generating the next number, especially in a multi-user environment. If I need an autonumber, I sometimes consider using a date/time stamp as a long string. htwh,

Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
Yes I tried that couple of times and it is tedious and very long process as I have over 60 tables in the database.

Since I need to reset database often, I need a quicker, simpler and safer way of doing it.
 
One method would be to create an Export Routine that creates a new MS Access Database, then loops through tables and exports them. Then truncate and compact the newly created Export database.

Or keep a master copy of the tables, empty in a database and then create the new Export copies from that empty database.

htwh,

Steve Medvid
"IT Consultant & Web Master"

Chester County, PA Residents
Please Show Your Support...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top