Rename a table in anoter database

J

JP

I would like to rename a table in another database.

I'd like to use DoCmd.Rename (or equilalent) on a table in a database that
is not the active database.

Thanks.
 
D

Dirk Goldgar

JP said:
I would like to rename a table in another database.

I'd like to use DoCmd.Rename (or equilalent) on a table in a database that
is not the active database.


You could do something like this:

Dim db As DAO.Database

Set db = DBEngine.OpenDatabase("C:\Your Path\To\YourDatabase.mdb")

db.TableDefs("OldTableName").Name = "NewTableName"

db.Close
 

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

Similar Threads


Top