I have a client using of all things DBF files. Now I run the code below and can refresh the links but when I try to change the td.connect by uncommenting it, I get the error the path is invalid. Any ideas?
Function relinkDBF() Dim db As DAO.Database, rs As DAO.Recordset, tds As DAO.TableDefs, td As DAO.TableDef, ErrCount As Integer Set db = CurrentDb Set tds = db.TableDefs On Error GoTo Err_Proc For Each td In tds 'td.Connect = "dBASE III;HDR=NO;IMEX=2;ACCDB=YES;DATABASE= C:\Users\Sergi.Arthur\Desktop\TJS051622" If Right(td.SourceTableName, 3) = "DBF" Then Debug.Print Right(td.SourceTableName, 3), td.SourceTableName, td.NAME, td.Connect td.RefreshLink End If Next Exit_Proc: Exit Function Err_Proc: Select Case Err.NUMBER Case 3011 ErrCount = ErrCount + 1 Resume Next Case Else MsgBox Err.NUMBER & "-" & Err.Description Resume Exit_Proc End Select End Function



Reply With Quote
