Good day! Beside clicking DEL from the keyboard, is there a way (code) to delete the whole table? not just the content. It is when am importing data from excel, there's a dump table created. Thanks in advance!
Good day! Beside clicking DEL from the keyboard, is there a way (code) to delete the whole table? not just the content. It is when am importing data from excel, there's a dump table created. Thanks in advance!
currentdb.execute "Delete * From YOURTABLENAME_HERE ;" <<deletes records
currentdb.execute "DROP TABLE table_name;" <<<deletes table and data
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
Doesn't repeatedly deleting and recreating the table cause db bloat? At least I'm guessing that the import from Excel is going to happen over an over again. When importing, you have the option to overwrite the whole table without deleting or append to it, no? Have to confess I have not done much of that so I'm asking more than suggesting a route to take.
The more we hear silence, the more we begin to think about our value in this universe.
Paraphrase of Professor Brian Cox.
When I created a small DB for a UK bank I was working at, I had to import a stupidly large Excel sheet (for what we needed at least), and find what we needed.
Now I realise linking to a static named workbook would have been better, and failing that a side DB for any imports. The DB bloated regularly.
Alas, that knowledge is now moot, as I retired.
That is where Foxpro comes into it's own, as well as the much better speed, the ZAP command.
Please use # icon on toolbar when posting code snippets.
Cross Posting: https://www.excelguru.ca/content.php?184
Debugging Access: https://www.youtube.com/results?sear...bug+access+vba
Paul,
I provided both Delete and Drop more for info/instruction since the OP doesn't seem to be aware of either.
Regarding other points in the thread -- bloat etc, I think we need to know more about the processes involved and context. Often wise to do C&R and bkup during periods of multiple loading/processing/deleting.