strange error when trying to import via code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I had a routine for importing a text file working perfectly, last week. When
I tried it today on another file with the identical structure I got:

"Reserved error (-5400); there is no message for this error."

The code was:

DoCmd.TransferText acImportFixed, , strTable, strPath, False

Any ideas?

Thanks!
 
Hi Allen,

My first thought is that since it's a fixed-width file and you're not
using an import specification, presumably you're using schema.ini. Is
schema.ini in the same folder as the new file, and does it contain a
section headed with the filename?

After that: IME most problems with importing text files stem from
irregularities within the files.
 
Thanks John,
My first thought is that since it's a fixed-width file and you're not
using an import specification, presumably you're using schema.ini. Is
schema.ini in the same folder as the new file, and does it contain a
section headed with the filename?

That must be it! Seems a silly implementation to me, when a template for
importing files has to contain the filename, but I suppose I could make my
program edit Schema.ini each time it imports a file with a different name.
 
That must be it! Seems a silly implementation to me, when a template for
importing files has to contain the filename, but I suppose I could make my
program edit Schema.ini each time it imports a file with a different name.

Either that, or have your code create a new schema.ini each time.
 
That must be it! Seems a silly implementation to me, when a template for
importing files has to contain the filename, but I suppose I could make my
program edit Schema.ini each time it imports a file with a different name.

[second thoughts] Or rename or move the import file to match the
schema.ini entry.
 

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

Back
Top