IMPORT DATA

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

i want to create a query that deletes all data from a table and then imports
new data from a text file. can i achieve that?

i want to avoid running the table delete-query and then importing the text
file and setting the import specifications since i have to follow this
procedure on a daily basis.

could you give me a hint???
 
Create a new macro:

Add these Action Items and Parameters:
OpenQuery "YourDeleteQueryName"
TransferText [See the parameter at the bottom, enter accordingly]
OpenQuery "YourAppendQueryName"
 
Hi Angie,

It seems that each day's text file has the same fields. If it also has
the same name every day, the simplest thing to do is probably to forget
about importing its data into an Access table. Instead,

1) Close your database and make a backup copy for safety.

2) Delete the table and compact the database.

3) Go to File|Get External Data|Link and create a linked table that gets
its data from the text file. You should be able to use the same import
specification as before. Give the linked table the same name as the
table you deleted.

Things should now work as normal - except that the data will be
retrieved from the text file rather than from a table in the database
itself. When the next day's file arrives, just

1) Close the database, or make sure that no queries, forms, reports etc.
that use the linked table are open.

2) Copy the new file over the existing one. Next time you use the linked
table, it will get the new data.

If each day's text file has a different name, you can choose a standard
name, and rename each day's file to that name so the linked table will
find it.
 
Back
Top