Linked Tables' Report


Question

Does anyone remember the code that produce a report for linked tables? I would like to know the source of the links.

Answer

Ivon,

Enclosed code produces a report (debug.print) of linked tables in CurrentDB().

HTH,
Shamil

P.S. The code:

Public Function GetConnectStrsList _
                (ByRef rdbs As DAO.Database) As VBA.Collection
  Dim tdf As DAO.TableDef
  Dim col As New VBA.Collection

  For Each tdf In rdbs.TableDefs
    If tdf.Connect <> "" Then
      On Error Resume Next
        col.Add tdf.Connect, tdf.Connect
      On Error GoTo 0
    End If
  Next

  Set GetConnectStrsList = col
End Function

Sub a_test()
  Dim col As VBA.Collection
  Dim var As Variant

  Set col = GetConnectStrsList(CurrentDb())
  For Each var In col
    Debug.Print var
  Next
End Sub

Copyright 1999-2008 by Shamil Salakhetdinov.  All rights reserved.