J
J. Shrimp, Jr.
This function will re-link all tables from a single external database:
Function LinkAllTables(sDbName As String)
Dim db As Database, tdf As TableDef
Set db = DBEngine.OpenDatabase(sDbName)
For Each tdf In db.TableDefs
If (tdf.Attributes And dbSystemObject) = 0 Then
AttachTable tdf.Name, sDbName
End If
Next
db.Close
End Function
Now, I would like to re-link all tables in several databases (.mde's
actually).
All databases are in the same directory,
but this code passes the string ' & strFileName &'
to the LinkAllTables function,
NOT the name of the actual MDE in the directory.
LinkAllTables function should link all mde's found in the directory.
What combination of &/'/" do I need to pass the name of
strFileName to LinkAllTables as found in line 4 below?
Dim strFileName As String
strFileName = Dir("v:\inventory\Building*.mde")
Do While strFileName <> ""
LinkAllTables (" & strFileName & ") 'pass strFileName to function
strFileName = Dir()
Loop
Function LinkAllTables(sDbName As String)
Dim db As Database, tdf As TableDef
Set db = DBEngine.OpenDatabase(sDbName)
For Each tdf In db.TableDefs
If (tdf.Attributes And dbSystemObject) = 0 Then
AttachTable tdf.Name, sDbName
End If
Next
db.Close
End Function
Now, I would like to re-link all tables in several databases (.mde's
actually).
All databases are in the same directory,
but this code passes the string ' & strFileName &'
to the LinkAllTables function,
NOT the name of the actual MDE in the directory.
LinkAllTables function should link all mde's found in the directory.
What combination of &/'/" do I need to pass the name of
strFileName to LinkAllTables as found in line 4 below?
Dim strFileName As String
strFileName = Dir("v:\inventory\Building*.mde")
Do While strFileName <> ""
LinkAllTables (" & strFileName & ") 'pass strFileName to function
strFileName = Dir()
Loop