Importing text error

N

Neil Crawford

Dear Someone,

I can't work out only the first field is imported when
trying to import a text delimited file with the following
command;-

DoCmd.TransferText acImportDelim, , "data", strPathName &
strFileName, -1

I only get the first column in the table (called Data)
with all the data in. I haven't specified the
argument "SpecificationName" as the help file states that
for delimited text files this argument can be left blank.

Any ideas would be gratefully received,

Regards,

Neil
 
K

Ken Snell

What delimiter are you using in the text file that you're trying to import?
Show us some sample records from that text file.
 
N

Neil Crawford

Ken,

thanks for the interest. I've tried tab and comma
delimiters, here's an example as part of the data;-

"ContactID" "FirstName" "InitialsInName"
"LastName" "HouseName" "FirstlineAddress"

1 "Wendy" "Aulds" "Dogends" "184
Prospect Road"

I only get the ContactID field header and 1st field of
the record through,

grateful for any insight,

regards,

Neil
 
K

Ken Snell

It appears that the file is delimited by the space character. In order to
import this, you'll need to create a specification that designates the
delimiter to be used. ACCESS defaults to a comma delimiter when you don't
specify a delimiter.
 

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