H
Holger Osterbuhr
Hi folks,
I want to change a link to a text file in an acc97-mdb. The structure of the
new textfile is the same, so I can reuse the specification. strFileName
contains the full path to the new *.txt file.
....
set dbs = CurrentDB
....
sPath = GetDirPart(strFileName)
sFile = GetFilePart(strFileName)
For i = 1 To Len(sFile)
cc = Mid(sFile, i, 1)
If cc = "." Then
Mid(sFile, i, 1) = "#"
End If
Next i
tdf.Connect =
"Text;DSN=MyFileSpec;FMT=Fixed;HDR=NO;IMEX=2;DATABASE=" & _
sPath & ";TABLE=" & sFile
Err = 0
On Error Resume Next
tdf.RefreshLink
....
dbs.TableDefs.Refresh
This code runs fine with no errors. But when I open the linked file in the
database windows again, the content is that of the old file - no relink took
place.
Where is the problem ?
Regards
Holger
I want to change a link to a text file in an acc97-mdb. The structure of the
new textfile is the same, so I can reuse the specification. strFileName
contains the full path to the new *.txt file.
....
set dbs = CurrentDB
....
sPath = GetDirPart(strFileName)
sFile = GetFilePart(strFileName)
For i = 1 To Len(sFile)
cc = Mid(sFile, i, 1)
If cc = "." Then
Mid(sFile, i, 1) = "#"
End If
Next i
tdf.Connect =
"Text;DSN=MyFileSpec;FMT=Fixed;HDR=NO;IMEX=2;DATABASE=" & _
sPath & ";TABLE=" & sFile
Err = 0
On Error Resume Next
tdf.RefreshLink
....
dbs.TableDefs.Refresh
This code runs fine with no errors. But when I open the linked file in the
database windows again, the content is that of the old file - no relink took
place.
Where is the problem ?
Regards
Holger