title: Converting DAO to ADO
body: <p>I am working with an Access 2003 database that has a subroutine using DAO code. This code loops through the table definitions and refreshes the ODBC connection string. I would like to convert this to ADO so I do not have to reference the DAO object library. Here is the code ...</p>
  
  <pre><code>Public Sub RefreshODBCLinks(newConnectionString As String)
  
      Dim db As DAO.Database
      Dim tb As DAO.TableDef
      Set db = CurrentDb
      For Each tb In db.TableDefs
          If Left(tb.Connect, 4) = "ODBC" Then
              tb.Connect = newConnectionString
              tb.RefreshLink
              Debug.Print "Refreshed ODBC table " &amp; tb.Name
          End If
      Next tb
      Set db = Nothing
  
      MsgBox "New connection string is " &amp; newConnectionString, vbOKOnly, "ODBC Links refreshed"
  
  End Sub
  </code></pre>
  
  <p>The part I am unsure of is how to loop through the tables and get/set their connection strings.</p>