Results 1 to 2 of 2
  1. #1
    Join Date
    Jun 2004

    Post Unanswered: iterate through all linked tables


    I want to be able to iterate through all the tables in a db and check to see if they are linked if so I want to get the source of the linked table.

    I wrote some code to do this in access 2002, it works on tables that I have created but it won't work if I open a 97 db, even if I convert the db then use the code. All I get for the connect string is "<unkown>".

    Does anyone know how to get round this??


    This is the code I am using:

    Public Sub FindLinks(sDBName As String)
        Dim db As Database
        Set db = OpenDatabase(sDBName)
        Dim tbDef As TableDef
        For Each tbDef In db.TableDefs
            If (tbDef.Attributes And dbAttachedTable) Then
                Debug.Print tbDef.Connect
            End If
        Set db = Nothing
    End Sub

  2. #2
    Join Date
    Jun 2004

    This was done to me not joing the system.mda secuirty file which meant I didn't have rights to view the design of the table, the code is ok.
    There are 10 types of people in this world. Those who understand binary and those who don't. - ThinkGeek

Posting Permissions

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