Results 1 to 3 of 3

Thread: Link to database

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Location
    Leicester study in leeds
    Posts
    28

    Link to database

    hi guys

    I have linked to an external daabase and am now trying to list all table names in this database. Des any one know how i can do this?

    Thanks

  2. #2
    Swatty
    Guest
    If your'e linked to it you can run through the tables

    VB Code:
    1. Dim dB As Database
    2.    Dim mtbld As TableDefs
    3.    Dim i  As Integer
    4.    Dim msg As Strring
    5.  
    6.    Set dB = CurrentDb()
    7.    Set mtbld = dB.TableDefs
    8.    
    9.    
    10.    For i = 0 To mtbld.Count - 1
    11.       If InStr(mtbld(i).Name, "Msys") = 0 And mtbld(i).Connect <> "" Then
    12.          msg = mtbld(i).Name & vbcrlf
    13.  
    14.       End If
    15.    Next
    16.    
    17.    msgbox msg
    18.    Set mtbld = Nothing
    19.    Set dB = Nothing
    This will show you all linked tables

  3. #3

    Thread Starter
    Junior Member
    Join Date
    May 2002
    Location
    Leicester study in leeds
    Posts
    28
    cheers swatty works a treat!!!

Posting Permissions

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



Click Here to Expand Forum to Full Width