By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,374 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

clear out a mdb database

P: n/a
hi

I have a database with several tables in it - some with autonumber columns.

Is it possible to clear out these tables so that all data is deleted and the
autonumber fields are set back to initial values

thanks for any help

D
Nov 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
diablo wrote:
hi

I have a database with several tables in it - some with autonumber
columns.

Is it possible to clear out these tables so that all data is deleted
and the autonumber fields are set back to initial values

thanks for any help

D


Create a new blank database and import all of the objects from this file into
the new one. In the import options you can specify "definition only" for the
tables so that none of the data is pulled over. Then compact the new file
afterwards.
--
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Nov 13 '05 #2

P: n/a
Certainly. You know how to delete the data. Then, with empty tables,
compact the database. This will reset the autonumbers.

diablo wrote:
hi

I have a database with several tables in it - some with autonumber columns.

Is it possible to clear out these tables so that all data is deleted and the
autonumber fields are set back to initial values

thanks for any help

D


--
Bas Cost Budde, Holland
http://www.heuveltop.nl/BasCB/msac_index.html
For human replies, replace the queue with a tea

Nov 13 '05 #3

P: n/a
If this is an action that you will use often (although I'm not sure why
you would) you could also do something like:

Function fClearAll()
If MsgBox("Delete all information?", vbQuestion + vbYesNo,
"Continue?") = vbYes Then
CurrentDb.Execute ("DELETE * FROM tbl_One;")
CurrentDb.Execute ("DELETE * FROM tbl_Two;")
MsgBox "Select Tools > Database Utilities > Compact and Repair
Database to reset autonumbers", 0, "Data cleared"
End If
End Function

Nov 13 '05 #4

P: n/a
If this is an action that you will use often (although I'm not sure why
you would) you could also do something like:


No, just once.

Thanks for all the help
Nov 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.