I am trying to use this code:
Code:
Sub Start()
Dim db As DAO.Database
Dim tdf As DAO.TableDef
Dim StringConnect As String
StringConnect = "Provider=SQLOLEDB;Data Source=NT-WRO1-PLAT01\SQLEX2014;Initial Catalog=Sody;User ID=sod;Password=Sod#2018"
Set db = CurrentDb
For Each tdf In db.TableDefs
' Only make a change if the table is a linked table
If Len(tdf.Connect) Then
tdf.Connect = StringConnect
tdf.RefreshLink
End If
Next
End Sub
But all the time windows forces me to choose DSN data source...:

Please help,
Jacek