F
FPS, Romney
Is it possible to use wildcards in specifying table names when refreshing
links to external databases?
I wish to link all tables beginning with "Home" (such as HomeAssessments,
HomeGoals, etc.) to one external database, and all other linked tables to
another database.
I've tried concatenating "Home" and "*", but that doesn't seem to work ...
strHomeTables1 = "Home"
strHomeTables2 = "*"
strHomeTables = strHomeTables1 & strHomeTables2
For Each tdf In Tdfs
If Len(tdf.Connect) > 0 And tdf.SourceTableName = strHomeTables Then
tdf.Connect = ";DATABASE=" & Database1
tdf.RefreshLink
ElseIf Len(tdf.Connect) > 0 And tdf.SourceTableName <> strHomeTables Then
tdf.Connect = ";DATABASE=" & Database2
tdf.RefreshLink
End If
'---------------------------------
I've also tried:
If Len(tdf.Connect) > 0 And Left(tdf.SourceTableName, 4) = "Home" Then
tdf.Connect = ";DATABASE=" & Database1
tdf.RefreshLink
Else If ...
Any help would be appreciated.
Thanks,
Mark.
links to external databases?
I wish to link all tables beginning with "Home" (such as HomeAssessments,
HomeGoals, etc.) to one external database, and all other linked tables to
another database.
I've tried concatenating "Home" and "*", but that doesn't seem to work ...
strHomeTables1 = "Home"
strHomeTables2 = "*"
strHomeTables = strHomeTables1 & strHomeTables2
For Each tdf In Tdfs
If Len(tdf.Connect) > 0 And tdf.SourceTableName = strHomeTables Then
tdf.Connect = ";DATABASE=" & Database1
tdf.RefreshLink
ElseIf Len(tdf.Connect) > 0 And tdf.SourceTableName <> strHomeTables Then
tdf.Connect = ";DATABASE=" & Database2
tdf.RefreshLink
End If
'---------------------------------
I've also tried:
If Len(tdf.Connect) > 0 And Left(tdf.SourceTableName, 4) = "Home" Then
tdf.Connect = ";DATABASE=" & Database1
tdf.RefreshLink
Else If ...
Any help would be appreciated.
Thanks,
Mark.