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
 
T

Tom van Stiphout

On Tue, 29 Apr 2008 21:41:54 -0700 (PDT), (e-mail address removed) wrote:

That sounds particularly malicious. Why is it not enough to delete
them manually?

-Tom.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top