acImportFixed

exo

Registered User.
Local time
Today, 14:48
Joined
May 21, 2009
Messages
23
I am currently using a
(DoCmd.Transfertext acImportFixed, "specification name", "table name", "source file", true) statement to bring in data. I've been using it for several months and I thought it was working fine.

Today I realize that in the event the input file only has 1 line of data in it, a blank file gets imported. That led me to check and realize that it is always ommiting the top line during the import.

For example, say my source file has 5 lines of data and I run the code. I end up with a table with 4 lines of data correctly parsed and named but one is missing. If the sourcefile only has one line of data - nothing is populated in the table at all.

If I manually hit import, choose the file, and then choose the spec and then just click "next" through the prompts then it imports every line just fine - so I know the problem is not with the import specification I have defined.

Has anyone else ever ran into this before? I am using Access 2003 SP3.
 
Last edited:
DoCmd.Transfertext acImportFixed, "specification name", "table name", "source file", False)

I believe that the last option should be False if your import file does not have field headers.
 
DoCmd.Transfertext acImportFixed, "specification name", "table name", "source file", False)

I believe that the last option should be False if your import file does not have field headers.

That was it. Not sure why I took that last part of the command for granted and never looked into what exactly was "true". thank you very much.
 

Users who are viewing this thread

Back
Top Bottom