Wrox Home  
Search P2P Archive for: Go

  Return to Index  

access thread: Removing all records from table before appending


Message #1 by "Eddie Schott" <eddie@p...> on Sun, 6 May 2001 13:59:24 -0700
I have append queries to fill tables in an Access 97 database.



I would like to make sure that the tables are empty by deleting them all

before the append query is executed.



In FoxPro, there is the ZAP command. Does Access have a similar action? If

not, how would I go about deleting all records before executing the append

query?



Related, is there a faster way to empty a table in datasheet view other

than:



1. Selecting all and then deleting



2. Copying structure to another table and deleting the original table.



Thanks!



--

Eddie Schott

Progressive Action Network



Message #2 by John Fejsa <John.Fejsa@h...> on Mon, 07 May 2001 09:57:08 +1000
Create a 'Delete' action query and run it just before your 'Append' action 

query.



_____________________________________



John Fejsa

Systems Analyst/Computer Programmer

Hunter Centre for Health Advancement

Locked Bag 10

WALLSEND NSW 2287

Phone: (02) 49246 336 Fax: (02) 49246 209



>>> eddie@p... 07/05/2001 6:59:24 >>>

I have append queries to fill tables in an Access 97 database.



I would like to make sure that the tables are empty by deleting them all

before the append query is executed.



In FoxPro, there is the ZAP command. Does Access have a similar action? If

not, how would I go about deleting all records before executing the append

query?



Related, is there a faster way to empty a table in datasheet view other

than:



1. Selecting all and then deleting



2. Copying structure to another table and deleting the original table.



Thanks!



--

Eddie Schott

Progressive Action Network



Message #3 by "John Ruff" <papparuff@c...> on Mon, 7 May 2001 02:11:36 -0700
To delete records from a table prior to appending, you can create a delete

query for each table and run each delete query, or in VBA,

DoCmd.runSQL "DELETE * FROM Table1"



In either case, make sure you turn Access warnings off, then back on after

the deletions. (DoCmd.SetWarnings True and DoCmd SetWarnings False)



I know of no other way to delete records any faster in datasheet view.





John Ruff - The Eternal Optimist :)

 -----Original Message-----

From: 	Eddie Schott [mailto:eddie@p...]

Sent:	Sunday, May 06, 2001 1:59 PM

To:	Access

Subject:	[access] Removing all records from table before appending



I have append queries to fill tables in an Access 97 database.



I would like to make sure that the tables are empty by deleting them all

before the append query is executed.



In FoxPro, there is the ZAP command. Does Access have a similar action? If

not, how would I go about deleting all records before executing the append

query?



Related, is there a faster way to empty a table in datasheet view other

than:



1. Selecting all and then deleting



2. Copying structure to another table and deleting the original table.



Thanks!



--

Eddie Schott

Progressive Action Network

Message #4 by "Derrick Flores" <Derrick_Flores@s...> on Mon, 07 May 2001 08:02:41 -0500
Try using the delete query, one of the query types that you can use.



1. Create a new query in design view

2. Select the table that you want to delete

3. Once you have the table in your query design view, click on the 'Query' 

menu

4. Then click on 'Delete Query'

5. Double click on the astrick in the table that you've selected, that 

will bring a field down into the first column (make sure that it has the 

name of the table and the ' * ' next to it)

6. If you want to delete every thing in that entire table that is all you 

have to do at this point.

7. if you want to delete records that meet some kind of criteria then you 

need to bring down the field(s) that will meet the require criteria then 

specify those criteria



Derrick A. Flores

Associate Systems Engineer

6" Line Engineering

Sony Electronic Inc.

Semiconductor San Antonio

1 Sony Place M/S 730

San Antonio, Texas 78245-2100

Telephone:  (xxx) xxx-xxxx

Fax:  (xxx) xxx-xxxx

Pager:  (xxx) xxx-xxxx

E-mail: derrick_flores@s...



>>> "Eddie Schott" <eddie@p...> 05/06 3:59 PM >>>

I have append queries to fill tables in an Access 97 database.



I would like to make sure that the tables are empty by deleting them all

before the append query is executed.



In FoxPro, there is the ZAP command. Does Access have a similar action? If

not, how would I go about deleting all records before executing the append

query?



Related, is there a faster way to empty a table in datasheet view other

than:



1. Selecting all and then deleting



2. Copying structure to another table and deleting the original table.



Thanks!



--

Eddie Schott

Progressive Action Network

Message #5 by "Rogers, Robert" <rrogers@b...> on Mon, 7 May 2001 08:04:54 -0400
Use a delete query.



Robert L. Rogers 

Application Developer, Rexel Branch Electric

(xxx)-xxx-xxxx





-----Original Message-----

From: Eddie Schott [mailto:eddie@p...]

Sent: Sunday, May 06, 2001 4:59 PM

To: Access

Subject: [access] Removing all records from table before appending





I have append queries to fill tables in an Access 97 database.



I would like to make sure that the tables are empty by deleting them all

before the append query is executed.



In FoxPro, there is the ZAP command. Does Access have a similar action? If

not, how would I go about deleting all records before executing the append

query?



Related, is there a faster way to empty a table in datasheet view other

than:



1. Selecting all and then deleting



2. Copying structure to another table and deleting the original table.



Thanks!

Message #6 by "Levine, Lloyd" <LEVINLL@m...> on Mon, 7 May 2001 08:54:04 -0400
Ed,



You can either make a delete query or create a macro which will allow you to

select all the records from a table and then delete them. If you choose to

create a macro, make sure you first set allWarnings = False. This will

prevent the "Are you sure you want to do this message" from appearing.



-----Original Message-----

From: Eddie Schott [mailto:eddie@p...]

Sent: Sunday, May 06, 2001 4:59 PM

To: Access

Subject: [access] Removing all records from table before appending





I have append queries to fill tables in an Access 97 database.



I would like to make sure that the tables are empty by deleting them all

before the append query is executed.



In FoxPro, there is the ZAP command. Does Access have a similar action? If

not, how would I go about deleting all records before executing the append

query?



Related, is there a faster way to empty a table in datasheet view other

than:



1. Selecting all and then deleting



2. Copying structure to another table and deleting the original table.



Thanks!



--

Eddie Schott

Progressive Action Network

Message #7 by "Pardee, Roy E" <roy.e.pardee@l...> on Tue, 08 May 2001 08:12:45 -0700
Depending on your application, you may be able to substitue a make-table

query for you append query--that will automatically delete the original data

before running.  If you issue a "DoCmd.SetWarnings False" beforehand, you'll

get out of the warning dialog.



As for manually emptying a table, one good way is to:

	ctrl-c copy the original table

	ctrl-v to paste a new table, selecting "structure only"

	delete the original table

	rename the newly-copied table to the original table's name



But that bit probably won't work on tables where you're enforcing

referential integrity.



HTH,



-Roy



-----Original Message-----

From: Eddie Schott [mailto:eddie@p...]

Sent: Sunday, May 06, 2001 1:59 PM

To: Access

Subject: [access] Removing all records from table before appending





I have append queries to fill tables in an Access 97 database.



I would like to make sure that the tables are empty by deleting them all

before the append query is executed.



In FoxPro, there is the ZAP command. Does Access have a similar action? If

not, how would I go about deleting all records before executing the append

query?



Related, is there a faster way to empty a table in datasheet view other

than:



1. Selecting all and then deleting



2. Copying structure to another table and deleting the original table.



Thanks!



--

Eddie Schott

Progressive Action Network






  Return to Index