Linked Table from code

  • Thread starter Thread starter Ian Chappel
  • Start date Start date
I

Ian Chappel

How can I change the name of a table (csv) to which I have a link, via code?

The path's always the same, but the name of the table is always the current
date, such as 20070628.csv. I don't want to have to rename this file or use
the Linked Table Manager every time. (No problem to build the filename, just
how to programmatically change the link).
 
I wouldn't do it that way. I would use the TransferText method and establish
the link programatically.

strFileName = strPath & "\" & Format(Date,"yyyymmdd") & ".csv"
DoCmd.TransferText acLinkDelim, , "MyTableName", strFileName, True
 
OK, all sorted, thanks

Klatuu said:
I wouldn't do it that way. I would use the TransferText method and
establish
the link programatically.

strFileName = strPath & "\" & Format(Date,"yyyymmdd") & ".csv"
DoCmd.TransferText acLinkDelim, , "MyTableName", strFileName, True
 
Back
Top