Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2004
    Location
    Concord, MA
    Posts
    27

    Unanswered: Database Link Table

    hi,

    can anyone tell me in database which table stores the database link definitions. we are on 9.2.x.

    thanks,
    bagchi
    ~bagchi

  2. #2
    Join Date
    Oct 2003
    Location
    Canada
    Posts
    574
    each table stores it's own link information in the Connect table property. I use this code to relink:

    counttables = dbs.TableDefs.count

    BaseDir = left(FileName, InStr(FileName, "tx") - LeftAmount)
    Common = BaseDir & "Common.mdb"
    Main = BaseDir & "Main.mdb"

    For intCount = 0 To counttables - 1
    CalcPct = Int(intCount / counttables * 100)
    Set tdf = dbs.TableDefs(intCount)
    ' If the table has a connect string, it's a linked table.
    Check = tdf.Connect
    If Len(Check) > 0 Then
    tablename = tdf.Name
    If InStr(Check, "Common") > 0 Then
    LinkFileName = Common
    ElseIf InStr(Check, "Main") > 0 Then
    LinkFileName = Main
    Else
    LinkFileName = FileName
    End If
    LinkFileName = left(Check, InStr(Check, "DATABASE") + 8) & LinkFileName

    If tdf.Connect <> LinkFileName Then
    tdf.Connect = LinkFileName
    tdf.RefreshLink ' Relink the table.
    End If
    End If
    Next intCount

Posting Permissions

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