Import but not append each time!

message from Koulla on 17 May 2004
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
 
=?Utf-8?B?Qm9uZyBSYW1vcw==?= replied to Koulla on 17 May 2004
Try running a delete query first on the entire table before executing the transferdatabase macro.
 
=?Utf-8?B?Um9zY28=?= replied to Koulla on 17 May 2004
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 helps
Rosco
 
Michelle replied to Koulla on 17 May 2004
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

"Koulla" <anonymous@discussions.microsoft.com> wrote in message
news:df8301c43bf7$46821e70$a501280a@phx.gbl...
 

Archived message: Import but not append each time! (Microsoft Access Database)