A97 - Relink A Textfile Doesn't Work

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top