Linked Table value

Discussion in 'Microsoft Access External Data' started by hmlim, Jul 7, 2003.

  1. hmlim

    hmlim Guest

    Hi, all
    anybody know how to get a linked table path value using VBA code?
    I have a table is a linked table, inside my VBA code, I need to know
    where the external source for linked table, can anybody help?


    hmlim
     
    hmlim, Jul 7, 2003
    #1
    1. Advertisements

  2. Here is some DAO code that will do waht you need:

    Dim db As Database
    Dim varTable As Variant
    Dim strTableName As String
    Dim strFileAndPath As String
    Set db = CurrentDb
    For Each varTable In db.TableDefs
    If Len(varTable.Connect) > 1 Then 'its a linked table
    strTableName = varTable.Name
    'linked tables start with ";DATABASE="
    'so we need to strip that away
    strFileAndPath = Mid(varTable.Connect, 11, Len
    (varTable.Connect) - 10)
    End If
    Next
    Set db = Nothing

    -Cameron Sutherland

    >-----Original Message-----
    >Hi, all
    > anybody know how to get a linked table path value

    using VBA code?
    > I have a table is a linked table, inside my VBA code,

    I need to know
    >where the external source for linked table, can anybody

    help?
    >
    >
    >hmlim
    >
    >
    >.
    >
     
    Cameron Sutherland, Jul 7, 2003
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim Heames

    Linked Table Manager does not display linked tables

    Tim Heames, Jan 13, 2004, in forum: Microsoft Access External Data
    Replies:
    2
    Views:
    641
    Joan Wild
    Jan 14, 2004
  2. Guest

    Exporting non-linked and linked tables together

    Guest, Jan 11, 2005, in forum: Microsoft Access External Data
    Replies:
    2
    Views:
    189
    Guest
    Jan 12, 2005
  3. Don

    Linked Table Manager Not Showing List of Linked Tables

    Don, Oct 18, 2005, in forum: Microsoft Access External Data
    Replies:
    4
    Views:
    2,815
  4. Guest

    I cannot modify a linked table in access (linked to excel).

    Guest, Apr 29, 2006, in forum: Microsoft Access External Data
    Replies:
    3
    Views:
    2,866
    Guest
    Apr 30, 2006
  5. Guest

    Linked table Manager; how can I automate changing of the linked ta

    Guest, Jul 7, 2006, in forum: Microsoft Access External Data
    Replies:
    2
    Views:
    493
    Guest
    Jul 7, 2006
Loading...

Share This Page