How do I empty a table?

  • Thread starter Thread starter Steve Hayes
  • Start date Start date
S

Steve Hayes

I want to develop a database and test it with test data.

How do I empty the database of the test data when I've finished testing and
want to enter real data?

In Paradox it was easy and obvious, but in Access I haven't been able to find
it.
 
You write a series of queries that delete data from each table.
Delete the records in any child tables before you delete the records in any
parent tables.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
You write a series of queries that delete data from each table.
Delete the records in any child tables before you delete the records in any
parent tables.

Jeanette Cunningham MS Access MVP -- Melbourne Victoria Australia
 
You could run a delete query:

DELETE * FROM YourTable

If you use cascading deletes when you set up the relationships you can run
the query on the main table in the relationship, and the related records
will be deleted also.

I have been known to open the tables, and select and delete all test data.
In this case I think it's OK for the developer to work directly with the
tables.

When you are done, run compact and repair (after backing up first). This
will reset the autonumber to 1 (I can't say for sure how this works in
Access 2007, though). In general, compact and repair is a good idea before
deploying the database.
 
You could run a delete query:

DELETE * FROM YourTable

If you use cascading deletes when you set up the relationships you can run
the query on the main table in the relationship, and the related records
will be deleted also.

I have been known to open the tables, and select and delete all test data.
In this case I think it's OK for the developer to work directly with the
tables.

When you are done, run compact and repair (after backing up first). This
will reset the autonumber to 1 (I can't say for sure how this works in
Access 2007, though). In general, compact and repair is a good idea before
deploying the database.
 
AnSteve said:
I want to develop a database and test it with test data.

How do I empty the database of the test data when I've finished testing and
want to enter real data?

In Paradox it was easy and obvious, but in Access I haven't been able to find
it.
Another method would be to create a blank database then import your
tables into it. When you select the tables to import you have an option
to bring over just the table definitions.

gls858
 
AnSteve said:
I want to develop a database and test it with test data.

How do I empty the database of the test data when I've finished testing and
want to enter real data?

In Paradox it was easy and obvious, but in Access I haven't been able to find
it.
Another method would be to create a blank database then import your
tables into it. When you select the tables to import you have an option
to bring over just the table definitions.

gls858
 
Another method would be to create a blank database then import your
tables into it. When you select the tables to import you have an option
to bring over just the table definitions.

Would that bring over everything except the data -- saved queries, etc?
 
Another method would be to create a blank database then import your
tables into it. When you select the tables to import you have an option
to bring over just the table definitions.

Would that bring over everything except the data -- saved queries, etc?
 
Would that bring over everything except the data -- saved queries, etc?

Sure, if you import the saved queries and the etc. (forms, reports, macros,
modules).

You can import selectively. Just use File... Get External Data... Import,
select the database, and choose what you want to import.
 
Would that bring over everything except the data -- saved queries, etc?

Sure, if you import the saved queries and the etc. (forms, reports, macros,
modules).

You can import selectively. Just use File... Get External Data... Import,
select the database, and choose what you want to import.
 
Sure, if you import the saved queries and the etc. (forms, reports, macros,
modules).

You can import selectively. Just use File... Get External Data... Import,
select the database, and choose what you want to import.

But this would imply that you haven't split your database. Here are a
bunch of reasons to do so, plus some links to help you with it:

http://allenbrowne.com/ser-01.html

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 
Sure, if you import the saved queries and the etc. (forms, reports, macros,
modules).

You can import selectively. Just use File... Get External Data... Import,
select the database, and choose what you want to import.

But this would imply that you haven't split your database. Here are a
bunch of reasons to do so, plus some links to help you with it:

http://allenbrowne.com/ser-01.html

Armen Stein
Microsoft Access MVP
www.JStreetTech.com
 
Back
Top