I have a front end client that needs to be able to connect to both SQL Server and Access. I have no problems switching from Access to SQL Server but when I try and switch from SQL Server to Access every technique has failed.
Despite providing what I believe is the correct connection string (it's the one I use when initially linking the tables to an Access back end) when the TDF.Refreshlink code executes I'm prompted to provide the DSN source.
Here's my code:
For Each Tdf In Dbs.TableDefs
If Len(Tdf.Connect) > 0 Then
Tdf.Connect = "MS Access;" & "PWD=XXXXX" & ";DATABASE=" & strFileName
Err = 0
On Error Resume Next
Tdf.RefreshLink
If Err <> 0 Then
RefreshLinks = False
Exit Function
End If
End If
Next Tdf
Any and all advice will be greatly appreciated.
Despite providing what I believe is the correct connection string (it's the one I use when initially linking the tables to an Access back end) when the TDF.Refreshlink code executes I'm prompted to provide the DSN source.
Here's my code:
For Each Tdf In Dbs.TableDefs
If Len(Tdf.Connect) > 0 Then
Tdf.Connect = "MS Access;" & "PWD=XXXXX" & ";DATABASE=" & strFileName
Err = 0
On Error Resume Next
Tdf.RefreshLink
If Err <> 0 Then
RefreshLinks = False
Exit Function
End If
End If
Next Tdf
Any and all advice will be greatly appreciated.