title: How do I create links to my tables in a password protected back end?
body: <p>I created an install for my database. However it loses the password for the linked tables to the back end.</p>
  <p>I need to relink all the tables on load.</p>
  <p>I found the below code to add specified table but I need to link all the tables in the back end DB and I don't want to repeat this code for every table.</p>
  <pre><code>Dim db As DAO.Database
  Dim tdf As DAO.TableDef
  Dim strConnect As String
  Dim strDbFile As String
  Dim strLinkName As String
  Dim strPassword As String
  Dim strSourceTableName As String
  
  strDbFile = &quot;c:documents\mydb&quot;
  strPassword = &quot;mypw&quot;
  strSourceTableName = &quot;tblcaseid&quot;
  strLinkName = &quot;link_to_caseid&quot;
  
  strConnect = &quot;MS Access;PWD=&quot; &amp; strPassword &amp; _
      &quot;;DATABASE=&quot; &amp; strDbFile
  Debug.Print strConnect
  Set db = CurrentDb
  Set tdf = db.CreateTableDef
  tdf.Connect = strConnect
  tdf.SourceTableName = strSourceTableName
  tdf.Name = strLinkName
  db.TableDefs.Append tdf
  
  End Sub
  </code></pre>