Import File

I

Ivan Jaramillo

I'm using DoCmd.TransferText to import a txt file into a
access table. My question is: how can I import the txt
file in a table that is located in a different DB of the
current DB????

Thanks for you help
 
J

John Nurick

Hi Ivan,

If the table already exists in the other database:
1) create a linked table to connect to it (File|Get External Data|Link).
2) specify the name of the linked table when you call
DoCmd.TransferText.

Otherwise, the alternatives include
A) Create the table in the other database and proceed as above
B) Instead of TransferText, create and execute a query using syntax ike
this to specify the textfile and destination database:

SELECT * INTO NewTable IN "D:\Folder\OtherDatabase.mdb"
FROM [Text;HDR=Yes;Database=D:\TextFileFolder\;].Filename#txt;
 

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