Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / General 1 / January 2006

Tip: Looking for answers? Try searching our database.

Can one clear a database of all data?  **Warning - Newbie**

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peace Frog - 23 Jan 2006 16:06 GMT
I'm wondering how experienced database designers deal with practice
data.  Once a database has been designed, built and tweaked, what does
one do with any practice data that might have been used.  Do you just
go through every table and delete meaningless records?  It seems like
there should be a command or process whereby a user could "reset" or
"initialize" a database - clearing all practice data, setting all
autonumber fields to start at 1, etc.
pietlinden@hotmail.com - 23 Jan 2006 16:28 GMT
easiest way is to write a macro that does something like:
1. SetWarnings False (off)
2. run all your delete queries
3. SetWarnings True (on)

Either that or import only the structure of all your tables - but then
you have to re-establish all the relationships...
David W. Fenton - 23 Jan 2006 17:47 GMT
> easiest way is to write a macro that does something like:
> 1. SetWarnings False (off)
[quoted text clipped - 4 lines]
>  then
> you have to re-establish all the relationships...

Uh, not if you import the relationships.

Signature

David W. Fenton                  http://www.dfenton.com/
usenet at dfenton dot com    http://www.dfenton.com/DFA/

Allen Browne - 23 Jan 2006 16:29 GMT
Yes, essentially you delete the data from each table.

Where you have defined relations with cascading deletes, you need not worry
about the child tables. Aside from that, you start with the lowest level
related tables, and work upwards towards the categories and lookup tables,
executing a series of DELETE query statements, such as:
   dbEngine(0)(0).Execute "DELETE FROM Table1;", dbFailOnError

Signature

Allen Browne - Microsoft MVP.  Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

> I'm wondering how experienced database designers deal with practice
> data.  Once a database has been designed, built and tweaked, what does
[quoted text clipped - 3 lines]
> "initialize" a database - clearing all practice data, setting all
> autonumber fields to start at 1, etc.
Peace Frog - 23 Jan 2006 17:22 GMT
>I'm wondering how experienced database designers deal with practice
>data.  Once a database has been designed, built and tweaked, what does
[quoted text clipped - 3 lines]
>"initialize" a database - clearing all practice data, setting all
>autonumber fields to start at 1, etc.

Thank-you for the prompt replies...
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.