Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2003
    Location
    Earth | North America | United States | California | Long Beach
    Posts
    62

    Unanswered: Determine Full Path in Linked Table

    I am looking in the Linked Table Manager in Access 2000 and I cannot see the entire path to a linked table.

    Is there a way to determine what the full path of the linked table is?

    Thank you,
    Jack

  2. #2
    Join Date
    Jul 2003
    Location
    Earth | North America | United States | California | Long Beach
    Posts
    62
    I found my solution...

    This was on the Microsoft knowledge base...
    __________________________________________________ ______
    '==========================================
    ' The GetLinkedDBName() function requires the name of a
    ' linked Microsoft Access table, in quotation marks, as an
    ' argument. The function returns the full path of the originating
    ' database if successful, or returns 0 if unsuccessful.
    '==========================================

    Function GetLinkedDBName(TableName As String)
    Dim db As DAO.Database, Ret
    On Error GoTo DBNameErr
    Set db = CurrentDb()
    Ret = db.TableDefs(TableName).Connect
    GetLinkedDBName = Right(Ret, Len(Ret) - (InStr _
    (1, Ret, "DATABASE=") + 8))
    Exit Function
    DBNameErr:
    GetLinkedDBName = 0
    End Function
    __________________________________________________ ______

    This worked very well for me.

    Jack

  3. #3
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1
    Originally posted by Jaash
    I found my solution...

    This was on the Microsoft knowledge base...
    __________________________________________________ ______
    '==========================================
    ' The GetLinkedDBName() function requires the name of a
    ' linked Microsoft Access table, in quotation marks, as an
    ' argument. The function returns the full path of the originating
    ' database if successful, or returns 0 if unsuccessful.
    '==========================================

    Function GetLinkedDBName(TableName As String)
    Dim db As DAO.Database, Ret
    On Error GoTo DBNameErr
    Set db = CurrentDb()
    Ret = db.TableDefs(TableName).Connect
    GetLinkedDBName = Right(Ret, Len(Ret) - (InStr _
    (1, Ret, "DATABASE=") + 8))
    Exit Function
    DBNameErr:
    GetLinkedDBName = 0
    End Function
    __________________________________________________ ______

    Here's some tuning:

    Function fGetLinkPath(strTable As String) As String
    Dim dbs As Database, stPath As String

    Set dbs = CurrentDb()
    On Error Resume Next
    stPath = dbs.TableDefs(strTable).Connect
    If stPath = "" Then
    fGetLinkPath = vbNullString
    'can change this to currentdb.name
    Else
    fGetLinkPath = right(stPath, Len(stPath) _
    - (InStr(1, stPath, "DATABASE=") + 8))
    End If
    Set dbs = Nothing
    End Function



    This worked very well for me.

    Jack

Posting Permissions

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