Rename linked tables

C

Cliff

How would you write a macro to loop through all the linked table names
and strip off the schema prefix (e.g. strip off the "dbo_" prefix) ?
 
D

Douglas J. Steele

I don't believe you can do it using a Macro, but it's pretty simple with
VBA:

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 = Mid$(tdfCurr.Name, 5)
End If
Next tdfCurr
 

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