can't make the TransferText work ??

G

Ginola

Hi, I have the text file like below

<TICKER>,<PER>,<DTYYYYMMDD>,<TIME>,<OPEN>,<HIGH>,<LOW>,<CLOSE>,<VOL>,<OPENINT>
0005.hk,D,20030512,000000,89.75,90,89,89,13761921
0005.hk,D,20030513,000000,89.25,89.25,88.25,88.5,10017937

and I try to import the text file into the table with 10 fileds, all
fields are under Text format.

The code I have error is
DoCmd.TransferText acImportDelim, "asx", "asxprice", strFileName, True

They just have the error message
"You can't import this file"

Does anyone know the problem ?


If I use another ASC text file

01/04/1999 0002.HK 32.17 32.17 31.67 32.17 1629956
01/05/1999 0002.HK 31.42 31.92 31.42 31.42 1968600

and try to import the data into a tablename "asxprice" with 7 text
fields

with the code
DoCmd.TransferText acImportDelim, "asxprice", "asxprice", strFileName,
False

It has another message
"The text file specification 'asx" does not exist. You cannot import,
export, , or link using the specification.

What should I put for the specification ??

thanks


Ginola
 
A

Andy Cole

Ginola

Your first file has 10 'Headings' but only 9 fields. Have you actually
saved a specification file called 'asx' in your DB by manually going through
the Import routine and saving an import specification (on the Advanced
window of the Text file import wizard)?

HTH

Andy
 
G

Ginola

thanks, I have solved the problem.


Ginola

Your first file has 10 'Headings' but only 9 fields. Have you actually
saved a specification file called 'asx' in your DB by manually going through
the Import routine and saving an import specification (on the Advanced
window of the Text file import wizard)?

HTH

Andy
 

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