Parenthese appears in Access 2000 (dbo)

  • Hi,

    I've got Access 2000 to access to a SQL Server and on another computer tables appears with (dbo) after the name of the table (and other objects) and on mine , not !

    I tried to search ( a too long time) on the web for an answer but you're my last chance .....;-((

    How can i make it appear or disappear ?

    Thanks a lot for help .....

    Olivier

  • if your login is not the owner the (dbo) will come up. if the login is the owner the (dbo) will not!

     


    * Noel

  • I have an MS Access database that is blank apart from standard utility functions that I always use.

    One of the routines loops through the tabledefs collection and removes any dbo_ prefixes from linked table names.

    You can call the linked table anything you want in Ms Access, it doesn't affect the name of the underlying source table.

  • Thanks but my problem is that dbo appear in suffixes with parentheses.

    I tried to remake it on my pc and delete my login in sql server, but i still have tables named like this : "Customers (dbo)".

    Let me know your code to go through tabledefs, plesae

     

  • This is assuming you have a reference to Microsoft Data Access Objects.

    Public Sub sbRename()

        Dim db As DAO.Database

        Dim tb As DAO.TableDef

       

        Set db = CurrentDb()

       

        For Each tb In db.TableDefs

            If Left(tb.Name, 4) = "dbo_" Then

                tb.Name = (Mid(tb.Name, 5))

            End If

        Next

        Set tb = Nothing

        Set db = Nothing

    End Sub

    In my case the tables are always prefixed with dbo_.

    In your case you would simply use

    If instr(1,tb.name,"(dbo)",vbTextCompare) then

        tb.name = left(tb.name,instr(1,tb.name,"(dbo)",vbTextCompare)-1)

    End If

    This is assuming your SQL Server tables/Views follow best practice and only contain alphanumerics.

     

  • Thanks for your help all.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply