title: MS Access - copying Linked Tables between mdb's
body: <p>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.</p>
  
  <p>I can drag-n-drop the table links between my two open mdb's - but that copies the data.</p>
  
  <p>I've also considered writing a couple of VBA functions that look something like</p>
  
  <pre><code>Set db = CurrentDb
  db.TableDefs.Refresh
  For Each myTable In db.TableDefs
      If Len(myTable.Connect) &gt; 0 Then
          '' export myTable.Name and myTable.Connect to a flat file (or table)
      End If
  Next
  </code></pre>
  
  <p>and</p>
  
  <pre><code>Set db = CurrentDb
  db.TableDefs.Refresh
  For Each ''row in flat file
      Set tdf = db.CreateTableDef([myTable.Name])
      tdf.Connect = [myTable.Connect]
      db.TableDefs.append tdf
  Next
  </code></pre>
  
  <p>Before I do so, is there an easier way that I've missed?</p>