Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Rename Multiple Tables at once

0 views
Skip to first unread message

DFruge

unread,
Dec 23, 2009, 11:08:29 AM12/23/09
to
I have an Access 2007 database that has a lot of linked tables and I
want to 'batch' rename them. For example, they all start with "dbo_"
and I want to rename all of them to "PM_". How can I make that
happen? I've been searching and cannot find a solution. Any help
that anyone can provide is greatly appreciated.

Douglas J. Steele

unread,
Dec 23, 2009, 11:52:56 AM12/23/09
to
Dim dbCurr As DAO.Database
Dim tdfCurr As DAO.TableDef

Set dbCurr = CurrentDb()
For Each tdfCurr In dbCurr.TableDefs
If Left(tdfCurr.Name, 4) = "dbo_" Then
tdfCurr.Name = "PM_" & Mid(tdfCurr.Name, 5)
End if
Next tdfCurr

Set tdfCurr = Nothing
Set dbCurr = Nothing

--
Doug Steele, Microsoft Access MVP
http://I.Am/DougSteele
(no e-mails, please!)

"DFruge" <dfr...@gmail.com> wrote in message
news:999e441f-629e-4ef3...@e4g2000prn.googlegroups.com...

Steve

unread,
Dec 23, 2009, 1:42:48 PM12/23/09
to
Be aware ythat your database will no longer work after you do this. All your
queries, forms, reports and code are designed to work with the existing
table names.

Steve
san...@penn.com


"DFruge" <dfr...@gmail.com> wrote in message
news:999e441f-629e-4ef3...@e4g2000prn.googlegroups.com...

John... Visio MVP

unread,
Dec 24, 2009, 1:05:56 PM12/24/09
to
Are you sure?

John... Visio MVP

"Steve" <notmy...@address.com> wrote in message
news:exHn6%23$gKHA...@TK2MSFTNGP05.phx.gbl...

0 new messages