Home > Mobile >  New table in SQL not showing in Access linked table manager
New table in SQL not showing in Access linked table manager

Time:01-26

I created a new view in my SQL backend. I would like to view it in Access front end. When I open the linked table manager to add it to Access, it does not appear. I refreshed/closed/reopened. For clarity, the database where the new view exists is already linked and many of its tables/views do show in the linked table manager but not the new one I just made.

I opened the linked table manager, expanded all tables in the linked sql server, and my table does not show.

CodePudding user response:

Verify that the new view has the same permissions as the views that already show up in Access. If permissions are different, modify the permissions on your view that is not showing up.

CodePudding user response:

Run a small function:

Public Function LinkNewTable( _
    ByVal TableName As String, _
    ByVal SourceTableName As String) _
    As Boolean

    Const Master    As String = "SomeCurrentlyLinkedTable"
    Const Schema    As String = "dbo"
    
    Dim Database    As DAO.Database
    Dim Table       As DAO.TableDef
    
    Dim Connect     As String
    Dim Success     As Boolean
    
    Set Database = CurrentDb
    Set Table = Database.TableDefs(Master)
    Connect = Table.Connect
    Table.Close
    
    Set Table = Database.CreateTableDef(TableName)
    Table.SourceTableName = Schema & "." & SourceTableName
    Table.Connect = Connect
    Database.TableDefs.Append Table
    Database.TableDefs.Refresh
    
    Success = Not CBool(Err.Number)
    
    Set Table = Nothing
    
    LinkNewTable = Success
    
End Function
  • Related