/ Published in: Visual Basic
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
Option Compare Database Public Sub RefreshODBCLinks(Optional newConnectionString As String) Dim db As DAO.Database Dim tb As DAO.TableDef Set db = CurrentDb Debug.Print "Refreshed ODBC table: " For Each tb In db.TableDefs If Left(tb.Connect, 4) = "ODBC" Then If Len(Trim(newConnectionString)) > 0 Then tb.Connect = newConnectionString End If tb.RefreshLink Debug.Print tb.Name End If Next tb Set db = Nothing End Sub Public Sub TestODBCLinks() RefreshODBCLinks End Sub