Linked Table from code

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).
 
K

Klatuu

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
 
I

Ian Chappel

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
 

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