Results 1 to 3 of 3

Thread: Access Runtime

  1. #1
    Join Date
    Dec 2010
    Posts
    2

    Unanswered: Access Runtime

    Hi,
    I want to run an Access 2007 application on a user machine using Runtime
    2007.
    How do I get to use Linked Table Manager to work with Runtime?

    Thank You

  2. #2
    Join Date
    Mar 2009
    Posts
    5,442
    Provided Answers: 14
    You can't as far as I know. You'll have to provide your own solution to manage linked tables, which is not very difficult.
    Code:
    Function List_Linked_Tables()
    
        Dim dbs As DAO.Database
        Dim tdf As DAO.TableDef
        
        Set dbs = CurrentDb
        For Each tdf In dbs.TableDefs
            If Len(tdf.Connect) > 0 Then
                Debug.Print "Table name: " & tdf.Name
                Debug.Print "Source table name: " & tdf.SourceTableName
                Debug.Print "Connection string: " & tdf.Connect
                Debug.Print
            End If
        Next
        Set dbs = Nothing
        
    End Function
    
    Function Refresh_Table_Link(ByVal TableName As String, ByVal Connection As String)
    
        Dim dbs As DAO.Database
        Dim tdf As DAO.TableDef
        
        Set dbs = CurrentDb
        Set tdf = dbs.TableDefs(TableName)
        tdf.Connect = Connection
        tdf.RefreshLink
        Set tdf = Nothing
        Set dbs = Nothing
    
    End Function
    
    Function Create_Linked_Table(ByVal TableName As String, ByVal Connection As String, Optional ByVal SourceTableName As String)
    
        Dim dbs As DAO.Database
        Dim tdf As DAO.TableDef
        
        Set dbs = CurrentDb
        Set tdf = dbs.CreateTableDef()
        If SourceTableName = "" Then SourceTableName = TableName
        tdf.Name = TableName
        tdf.SourceTableName = SourceTableName
        tdf.Connect = Connection
        dbs.TableDefs.Append tdf
        Set tdf = Nothing
        Set dbs = Nothing
    
    End Function
    Have a nice day!

  3. #3
    Join Date
    Dec 2010
    Posts
    2
    Thanks You help

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •