Delete tables from remote database

R

ryangus

I'd like to use an access database to delete all tables from another
access database. The tables to be deleted may grow or shrink in
number, hence I'd rather use code to ensure all tables are removed.
Any suggestions how to do this?

Regards,
Ranga
 
J

John W. Vinson

I'd like to use an access database to delete all tables from another
access database. The tables to be deleted may grow or shrink in
number, hence I'd rather use code to ensure all tables are removed.
Any suggestions how to do this?

Regards,
Ranga

If they're temp tables, you'll run the risk of having the temp database keep
bloating - deleting a table will not free up the space it occupied, and even
compacting the database won't necessarily recover all of it. What I've done
(based on advice from my teachers here) is to use the CreateDatabase() method
to create a new .mdb file and the CreateTable() method to add new tables to
it; or (if there is a common set of tables) just have a template scratch
database with empty tables and use Filecopy to make a new copy of it.
 
D

Douglas J. Steele

John W. Vinson said:
If they're temp tables, you'll run the risk of having the temp database
keep
bloating - deleting a table will not free up the space it occupied, and
even
compacting the database won't necessarily recover all of it. What I've
done
(based on advice from my teachers here) is to use the CreateDatabase()
method
to create a new .mdb file and the CreateTable() method to add new tables
to
it; or (if there is a common set of tables) just have a template scratch
database with empty tables and use Filecopy to make a new copy of it.

Tony Toews has an example at http://www.granite.ab.ca/access/temptables.htm
 
Top