Importing text file

marcuscoker

Registered User.
Local time
Yesterday, 23:38
Joined
Sep 28, 2005
Messages
49
Hi

Was wondering if anybody could help me


I have manually imported a text file to Access with field names. This works fine.
I then delete the contents of the table that i have created via the import and tried to re import the data to this table using a bit of code

Sub importme()
DoCmd.TransferText acImportDelim, , "visiongeneral", "\\Prague\Groups\it\E85672_general.txt", 1

End Sub


However when i run this i get an error message saying that the field names are not present in the destination table, (which is not the case). However, if i try and import to this table manually using the import wizzard this works fine. What could i do to fix this?

Thanks

Marcus
 

Attachments

  • ErrorMessage.gif
    ErrorMessage.gif
    5.3 KB · Views: 145
It looks like it is treating all of the fields as one.
Try setting up an import specification when you manually import the file, then on the last or second to last tab click advanced and save as, the name that you save the import spec as put in between the commas.


acImportDelim, , "visiongeneral"
 

Users who are viewing this thread

Back
Top Bottom