is it possible to delete all the records in a MSaccess table using c#?
+1
A:
Yes. This page has examples for connecting to an access DB and then just use a DELETE command.
David Stratton
2009-12-08 12:51:34
TRUNCATE is much faster
Winston Smith
2009-12-08 12:56:55
@Winston Smith: does MS Access support TRUNCATE?
onedaywhen
2009-12-08 13:08:08
No - No truncate in Access.
Simon
2009-12-08 17:34:07
My understanding is that the Jet/ACE database engine executes "DELETE * FROM table" as a truncate, i.e., replaces the old table with an empty duplicate. I just ran ?CurrentDB.Execute "DELETE * FROM tblGBTest" on a table with 7,148,975 records and the results were instantaneous.
David-W-Fenton
2009-12-08 22:36:52
@David W. Fenton: "DELETE * FROM..." -- that's a weird construct. Why not the standard "DELETE FROM..." Does adding an asterisk make it perform better?
onedaywhen
2009-12-09 08:34:45