![]() |
![]() |
テーブル系 - リンクテーブルのリンク先を収集する | |
カレントデータベース内にあるすべてのテーブルを探索し、”リンクテーブル”であるものについて、そのリンク先のデータベースファイルのパスを収集します。
Sub Sample_1_11() 'リンクテーブルのリンク先を収集する Dim dbs As Database Dim tdf As TableDef Dim strConnect As String Set dbs = CurrentDb For Each tdf In dbs.TableDefs With tdf If .Attributes And dbAttachedTable Then strConnect = .Connect strConnect = Mid$(strConnect, InStr(strConnect, ";DATABASE=") + Len(";DATABASE=")) Debug.Print .Name, Debug.Print strConnect End If End With Next tdf End Sub 実行例:
![]() |
|||
|
Copyright © T'sWare All rights reserved | ![]() ![]() |