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?
Printable View
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?
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
Thanks Ian, I'll give it a go.