Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Owner prefix on linked sql tables - dbo_tablename 1

Status
Not open for further replies.

antvon

Programmer
Dec 2, 2002
45
Hi

Does anyone know how to link a sql table in access without the linked name
showing the owner prefix. ie
dbo_tablename to just tablename.

Is there perhapes a setting I can change (I now this is a long shot)
Abviously I could just rename the link but sometimes theres quite a lot of tables.
The only benefit for me is that I can navigate quicker to a table if it starts with the original name.

If anyone has any suggestions on work arounds I'd appreciate that as well

Thanks in advance
 
You can rename the tables using code and this makes sense if there are a lot of links.

Code:
Public Sub Remove_dbo_prefix()
Dim db As DAO.Database
Dim tbl As DAO.TableDef

Set db = CurrentDb()

For Each tbl In db.TableDefs
    If Left(tbl.Name, 4) = "dbo_" Then
        tbl.Name = Right(tbl.Name, Len(tbl.Name) - 4)
    End If
Next
End Sub

With versions of Access from 2000 on you would need to add a reference to the Microsoft DAO library.
 
Thanks cheerio

That will do the trick as well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top