Import text file problem

S

Stahlhelm

Can anyone help me with this....


I am trying to set it up so I can import a tab delimited text file (into a
table called Table1) via a visual basic sub-routine.

The critical code I am using is as follows;

DoCmd.TransferText acImportDelim, , "table1", "filename", True

The text file has headers named :"Field1" "Field2" and "Field3" and the
data is properly formatted below.

The code above generates an error as follows Field "Field1_field2_field3"
does not exist in the destination table.
ie it is interpreting the data as being all in one column. However if I
import via "file| get external data" the data imports correctly.
I have tried creating an import specification file and putting the name of
that as the second argument of the code above but the same error occurs.
This is sending me round the twist so please if anyone can help I will be
most grateful

Thanks in advance
 
G

Guest

Your pre-existing Table format and your imported file format do not seem to
be identical - at least according to Access...

So on the side experiment by doing a manual import to a completely new
virgin Table...let the Wizard do its thing.... and then take a look at that
Table. You should be able to compare the properties of this newly made
table with your existing destination Table.

You could now re-use this table for your destination table.

This experimental manual import may also surface problems with the importing
file...is the Access Wizard is not able to interpret the correct method to
import then you can experiment with the file format/layout....
 

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