Results 1 to 3 of 3

Thread: Clearing a table (Access type DB)

  1. #1

    Thread Starter
    Fanatic Member coox's Avatar
    Join Date
    Oct 1999
    Posts
    550
    Anyone know a quick way to clear the entire contents of a table in an Access type database? Or do I really have to loop through every record and delete them one by one?

  2. #2
    Fanatic Member Ianpbaker's Avatar
    Join Date
    Mar 2000
    Location
    Hastings
    Posts
    696

    Talking

    Hi Coox

    Instead of Looping through every recordset, use the database.execute statement with a SQL statement.

    db.execute "DELETE tbltest"

    This will delete all the records but leave the structure Intact. Depending on what database you are using, you might need DELETE FROM tbltest.

    Hope This Helps

    Ian
    Yeah, well I'm gonna build my own lunar space lander! With blackjack aaaaannd Hookers! Actually, forget the space lander, and the blackjack. Ahhhh forget the whole thing!

  3. #3

    Thread Starter
    Fanatic Member coox's Avatar
    Join Date
    Oct 1999
    Posts
    550
    Thanks Ian, I'll give it a go.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width