Import but not append each time!

K

Koulla

I have a table Stud that I import from a Stud.txt file.
Every week Stud.txt file will be change. I have a macro
that import Stud file but every time I import it to access
it append Stud.txt file to Stud access table. The macro
contains TransferText. In TransferText Type I have Import
Delimited. Can I do the import but to not append the file
each time?? By macro or by other way?

Thanks a lot!
Koulla
 
R

Rosco

If you need to keep the table structure for "Stud" intact, then I would suggest that you create a delete query against that table. A delete query will only delete the records in the "Stud" table, leaving the table structure intact

Next, in your macro, Insert a row above your import commands, and select the "OpenQuery" action. Enter your query name where indicated, and save the macro

Now, when you run your macro, it will clear out all the records in the "Stud" table, before it imports your new records
Your other option is to do a DeleteObject action on the "Stud" table, deleteing the table entirely, then modifying your import macro to import to a new table each time.

Hope this help
Rosco
 
M

Michelle

If you don't want to append, you just want to overwrite, you will need to
delete all the data in the Stud table before importing using TransferText.

If you want to still use a macro, you would add a new Action prior to your
TransferText, ie,

1st Action: RunSQL, SQL Statement: DELETE * FROM STUD;
2nd Action: TransferText, yada yada
 
B

Bong Ramos

Try running a delete query first on the entire table before executing the transferdatabase macro.
 

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