SFWolverine
asked on
delete all access tables with a prefix
I have a list of tables in an access mdb ... i want to delete all tables with a particular prefix within the mdb and delete the tables in a directory with the same table names. For example: tables -- sample_1, sample_2 ... (all tables beginning with "sample" would be deleted) and a directory "C:/" ... there are tables sample_1.xls, sample_2.xls, ... these table would also be deleted.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
dim db as dao.database, td as dao.tabledef
for each td in db.tabledefs
if td.name like "sample_*" then
db.execute "drop table " & "[" & td.name & "]"
next