Shigeshi Hitoshi > 23-09-13, 03:16 PM
paulsteigel > 23-09-13, 11:44 PM
Function RemapLinks(Optional PwdString As String = "", Optional tPath As String = "") As DatabaseErrors
' We will create a virtual link herein
Dim tdf As Object, TblName As String
Err.Clear
On Error GoTo ErrHandler
For Each tdf In CurrentDb.TableDefs
If InStr(tdf.Connect, ";DATABASE") <> 0 Then
If InStr(tdf.Name, "qry_") <> 0 Then
' Just do nothing
Else
tdf.Connect = "Ms Access;UID=Admin;PWD=" & PwdString & ";DATABASE=" & tPath
TblName = tdf.Connect
tdf.RefreshLink
End If
End If
Next
Set tdf = Nothing
Exit Function
ErrHandler:
RemapLinks = Err.Number
If Err.Number <> 0 Then WriteLog "RemarpLink", Err.Description
End Function
Shigeshi Hitoshi > 25-09-13, 04:17 PM