MS Access - copying Linked Tables between mdb's
I need to copy a large number of linked tables to another mdb, but I want them to stay links and not copies of the data.
I can drag-n-drop the table links between my two open mdb's - but that copies the data.
I've also considered writing a couple of VBA functions that look something like
Set db = CurrentDb
db.TableDefs.Refresh
For Each myTable In db.TableDefs
If Len(myTable.Connect) > 0 Then
'' export myTable.Name and myTable.Connect to a flat file (or table)
End If
Next
and
Set db = CurrentDb
db.TableDefs.Refresh
For Each ''row in flat file
Set tdf = db.CreateTa开发者_如何学JAVAbleDef([myTable.Name])
tdf.Connect = [myTable.Connect]
db.TableDefs.append tdf
Next
Before I do so, is there an easier way that I've missed?
If you choose File->Get External Data->Import and import a linked table, you will find that it has imported a link, not the table itself.
精彩评论