Import Specification does not work through VBA script

davper

Registered User.
Local time
Today, 18:21
Joined
Nov 15, 2006
Messages
18
I am open to alternatives to my problem.
Using Access 2007 on Win XP

I have created an import spec and saved it as TODImport. When done as a manual import it works as it should. But when run as a VBA Script (DoCmd.TransferText acImportDelim, "TODImport", "tmpTable", strFile), it does not.

The table gets created with the proper headings for all 27 fields, but the data gets placed in up to the first 3 fields.

The source file is a Fixed Width text file

Any idea why?


I am saving to a temp table so I can then reimport to the correct table and add the source file as a field and format dates and amounts correctly.
 
first of all, try:
Code:
docmd.runimportexport "importspecNameHere"
 
first of all, try:
Code:
docmd.runimportexport "importspecNameHere"

I assume you mean 'runsavedimportexport'.
I cannot specify the file to import at runtime. The name is never the same.
 
I need a dope slap. Any volunteers?

Just noticed I should be using acImportFixed instead of acImportDelim. Works as it should now.
 
I need a dope slap. Any volunteers?

Just noticed I should be using acImportFixed instead of acImportDelim. Works as it should now.

smile2.jpg


Missed that one too. :D
 
How did you create the specification? Did you do it this way:
http://www.btabdevelopment.com/ts/default.aspx?PageId=25

If so, I could swear that I've seen many problems with the fixed width import as opposed to the delimited format.

Bob,

I've seen numerous posts on this too, and not because someone needed a dope slap either. :rolleyes:

I believe there are unknown issues still lingering out there with that particular method, but I have been unable to find out what they are at this point. I've seen many posts on it.
 

Users who are viewing this thread

Back
Top Bottom