Results 1 to 3 of 3

Thread: Backup Path

  1. #1
    Join Date
    May 2003
    Location
    UK
    Posts
    28

    Unanswered: Backup Path

    Hi

    How can I get the path of the backend (Linked tables) using VB?

    Thanks

  2. #2
    Join Date
    Oct 2003
    Location
    Ger
    Posts
    1,969
    Provided Answers: 1

    Re: Backup Path

    Originally posted by Mara
    Hi

    How can I get the path of the backend (Linked tables) using VB?

    Thanks
    Use the next Code

    ' This code was originally written by Dev Ashish.
    ' It is not to be altered or distributed,
    ' except as part of an application.
    ' You are free to use it in any application,
    ' provided the copyright notice is left unchanged.
    '
    ' Code Courtesy of
    ' Dev Ashish
    '
    '

    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

    Sub sListPath()
    Dim loTd As TableDef
    CurrentDb.TableDefs.Refresh
    For Each loTd In CurrentDb.TableDefs
    Debug.Print fGetLinkPath(loTd.Name)
    Next loTd
    Set loTd = Nothing
    End Sub

    '*************** Code End **************

  3. #3
    Join Date
    May 2003
    Location
    UK
    Posts
    28
    Many Thanks

Posting Permissions

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