troubleshooting Question

Re Link data

Avatar of chestera
chestera asked on
Microsoft Access
10 Comments1 Solution59 ViewsLast Modified:
Hi EE
I have the following code to re-link data
Dim strPathBE As String
Dim tdf As TableDef

With FileDialog(msoFileDialogFilePicker)
    If Not .Show Then Exit Sub
    strPathBE = .SelectedItems(1)
End With
With CurrentDb
    For Each tdf In .TableDefs
        If tdf.Attributes And dbSystemObject Then
        ElseIf Len(tdf.Connect) = 0 Then
        ElseIf Left(tdf.Connect, 1) <> ";" Then
        Else
            tdf.Connect = ";DATABASE=" & strPathBE
            tdf.RefreshLink
        End If
    Next tdf
    Me!txtLoc = strPathBE
   
End With

It works if data has no password. I assume it needs some extra code to handle password.
something at the end of this line perhaps
 tdf.Connect = ";DATABASE=" & strPathBE (Password)

Any help appreciated

chestera
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 10 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 10 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros