Import Text file using transferText

R

Rob P

I am using 2003

By experimenting I have used the import file wizard to import a txt file
then saved the "wizard" as Enrol Import Specification.

Then using the following code the file is imported OK

DoCmd.DeleteObject acTable, "Enrol"

DoCmd.TransferText acImportDelim, "Enrol Import Specification",
"tblEnrol", "C:\session\enrol.txt", 0

This imports the file to the front end can you help with the placing the
tblEnrol table in to the back end. Have tried J:/etc but this no luck

Many Thanks
 
D

Dirk Goldgar

Rob P said:
I am using 2003

By experimenting I have used the import file wizard to import a txt
file then saved the "wizard" as Enrol Import Specification.

Then using the following code the file is imported OK

DoCmd.DeleteObject acTable, "Enrol"

DoCmd.TransferText acImportDelim, "Enrol Import Specification",
"tblEnrol", "C:\session\enrol.txt", 0

This imports the file to the front end can you help with the placing
the tblEnrol table in to the back end. Have tried J:/etc but this no
luck

Many Thanks

If you start with a linked table named "Enrol", linked to the table in
the back-end, then probably your best bet is to ...

1. Empty (not delete) that table, then ....

2. Link (not import) the text file as "EnrolImport", then ...

3. Use an append query to append all records from "EnrolImport" to
"Enrol", and then ...

4. Delete the table "EnrolImport".
 

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