Discussion Locked

Access: Append Query Data Source

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I needed help importing data from a text to an Access 2000 table. The text file changes weekly. I can clear the table with a delete query. A person who responded to my last question told me to do an append query with the text file as my data source. I found some items in the properties box but could not get it to function. Would someone give me details? Much appreciated.

5 replies

by peyison

First, you need to create a link to the text file. Choose File -> Get External Data -> Link Tables. From the Link dialog, change "Files of Type:" to "Text Files" and select your file. The Link Wizard will walk you through the steps of defining your text file - you can choose a delimiter, and assign names and data types to each field.

Once the file is linked it will appear in the Tables tab, and you can open it like any other table (it will be read only).

Now you can go to the query builder and create the append query. From the Query tab, select New. The only table you need to select is your text file table. Choose Query -> Append Query, and enter the table you want to append to. Then select the fields you want to append.

As long as the format of the text file does not change, you can replace the text file with a new one and the link will still work.

Hope this helps.

by donq

Answer 1 should get you started however you may(?) want to consider an Update (vs. Append) query. If records are to be replaced - a Delete / Appent is OK. If record archiving is needed Update is OK.

As stated by others also - Your incoming textfile "Format" MUST remain constant with only the stored data changing.

This discussion is closed to new replies.