Emptying out a database to start over

nexshark

Indentured Access-Serf
Local time
Today, 04:01
Joined
May 7, 2004
Messages
76
I have been testing data entry forms in a new database. Is there an easy way to reset the whole thing, autonumbers and all to new, as if nothing had ever been in the tables?

Thanks for your input.
 
Maybe with a "Delete all" query in a loop through Tabledefs, but I just worry about System tables. Also, that wouldn't reset the Autonumber.
 
Once you delete all of the data you can reset the autonumbers by running "Compact and Repair"
 
There's a better solution- you can reset autonumber using this code. No deletions needed.

That said, if you have a database corruption or bad macros jinxing up everything, then you can just go ahead and make a new blank database, then import in all data objects (but marcos if you're having trouble with marcos), from the old database then it'll work just dandy. Be sure to turn off auto correct if youdo that.

HTH.
 
No deletions needed.
But they said they wanted to delete all of the data to start fresh. If they want to clear the tables doesn't that mean delete? And then a quick compact and the autonumbers are reset.
 
Yes, I didn't understand that part first time.

Anyhow, at least they have another way to skin the autonumber. :D
 
Not knowing how to do a "'delete all' query thru tabledefs" (must be Gaelic or something) suggested by Newman, I deleted each record in each table, then reset the AutoNumbers by Compact and Repair. Thanks for that latter part, bob.
 
If you need to delete all records in a table, you just need to open table in table view, click the small gray box in upper left corner to select all (just like what you would do in Excel) then delete away. You'll get a warning of course, which you then click Yes, and it's all gone.

Also, if you have your relationships' integrity enforced with "Cascade Delete", you just need to start with your highest-level table and all children records will be automatically deleted in the process, speeding up the process.

HTH.
 
Thank you B.
I am slowly absorbing the flow of this program...another 10 years or so and.....

Thanks, again.
 
You could also create a new datafile import all tables from test db datafile without the data then compact and repair the new file.

then rename your test datafile and change the name of the new datafile for the old one so that it links back to the front end which will also need compacting.

doing that would leave you a test datafile intact for testing while updating the program for later versions
 

Users who are viewing this thread

Back
Top Bottom