PC Review


Reply
Thread Tools Rate Thread

Delete all data from every table?

 
 
=?Utf-8?B?cG9rZGJ6?=
Guest
Posts: n/a
 
      15th Feb 2006
Is there a simple way to delete all the data from every table?
 
Reply With Quote
 
 
 
 
=?Utf-8?B?ZGx3?=
Guest
Posts: n/a
 
      15th Feb 2006
set up a simple delete qurey for every table, then make a macro that runs all
the queries.

"pokdbz" wrote:

> Is there a simple way to delete all the data from every table?

 
Reply With Quote
 
tina
Guest
Posts: n/a
 
      15th Feb 2006
if this is a "one time" sort of thing, you can create a new, blank database,
then from the menu bar click File | Get External Data | Import. in the
Import wizard, click the Select All button on each tab, and then click the
Options button. in the Import Tables section, choose Definition Only. then
click OK to import.

if you need to do this on a recurring basis, you can use VBA code to loop
through all the table names, and execute a Delete query on each table.

hth


"pokdbz" <(E-Mail Removed)> wrote in message
news:7BB41060-AFF8-46D2-A69B-(E-Mail Removed)...
> Is there a simple way to delete all the data from every table?



 
Reply With Quote
 
=?Utf-8?B?T2Zlcg==?=
Guest
Posts: n/a
 
      15th Feb 2006
Try creating a loop through the tables in the mdb, and delete each one of them

Sub DeleteTables()
On Error GoTo Err_DeleteTables

Dim dbCurr As DAO.Database
Dim tdfCurr As DAO.TableDef
Dim strDescription As String

Set dbCurr = CurrentDb
For Each tdfCurr In dbCurr.TableDefs
Docmd.RunSQL "Delete * From " & tdfCurr.Name
Next tdfCurr

End_DeleteTables:
Set dbCurr = Nothing
Exit Sub

Err_DeleteTables:
MsgBox Err.Number & ": " & Err.Description
Resume End_DeleteTables

End Sub

--
\\// Live Long and Prosper \\//
BS"D


"pokdbz" wrote:

> Is there a simple way to delete all the data from every table?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Delete Data from Table and Import New Data Sam Microsoft Access 1 10th Jun 2009 05:54 PM
Delete Data in one table that is in another Table =?Utf-8?B?Q2hhZEQ=?= Microsoft Access Queries 2 14th Jun 2007 07:51 PM
Delete Table .vs Delete Data =?Utf-8?B?c3Bhcmtlcg==?= Microsoft Access VBA Modules 4 22nd Jun 2005 02:43 AM
Delete record data in Form and append data in table an Microsoft Access Forms 2 16th Feb 2004 09:46 AM
Delete records from one table based on the data in another table Sam Nesbitt Microsoft Access 0 26th Nov 2003 03:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:53 PM.