Solved Text File Import Error (1 Viewer)

pooldead

Registered User.
Local time
Today, 03:57
Joined
Sep 4, 2019
Messages
136
I am trying to import a text file but getting the following error:

"Field 'SubSystem_Screen_Owner Department_.... ' doesn't exist in destination table 'TableA'"

The problem is all of those fields are in my TableA, but it is inserting underscores between each header name. I've attached a snippet of how the headers look in the text file itself.
1592597274598.png
 

Isaac

Lifelong Learner
Local time
Today, 03:57
Joined
Mar 14, 2017
Messages
8,927
The first thing I wonder about is if the recognition of the text file's delimited columns is off. And so Access is trying to see it all as a single column. Being as it can't insert Tab characters into a column name, it's displaying the error message with underscores. I would triple-check your import specs vs. the content of the file..maybe the text file header column isn't quite matching up.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:57
Joined
Oct 29, 2018
Messages
21,584
Hi. How exactly are you performing the import? If by code, are you using a specification?
 

pooldead

Registered User.
Local time
Today, 03:57
Joined
Sep 4, 2019
Messages
136
I'm thinking all the space in the top row of the text file is causing those problems. As a workaround, I saved it as a .xlsx and then imported with no issues. Thanks pisorsisaac!
 

pooldead

Registered User.
Local time
Today, 03:57
Joined
Sep 4, 2019
Messages
136
Hi. How exactly are you performing the import? If by code, are you using a specification?
I didn't use a specification in the code, just left it blank. Would using a specification work better? I found a workaround as noted above, but I'd like to get it to work without the extra step.
 

Isaac

Lifelong Learner
Local time
Today, 03:57
Joined
Mar 14, 2017
Messages
8,927
I'm thinking all the space in the top row of the text file is causing those problems. As a workaround, I saved it as a .xlsx and then imported with no issues. Thanks pisorsisaac!
Well the whole delimited import process is based on the premise that the file has a delimited quality to it, and that that quality holds true for every single line, header included. So it depends on how you have your import specification (or not) set up. You definitely want to have one.
Glad you found a solution.
 

theDBguy

I’m here to help
Staff member
Local time
Today, 03:57
Joined
Oct 29, 2018
Messages
21,584
I didn't use a specification in the code, just left it blank. Would using a specification work better? I found a workaround as noted above, but I'd like to get it to work without the extra step.
Hi. Typically, you would use a specification when importing text files. I am not sure how it works without using one.
 

pooldead

Registered User.
Local time
Today, 03:57
Joined
Sep 4, 2019
Messages
136
I was able to confirm the text file is Tab Delimited. What specification would I use for that? I've never really had a clear understanding of the options for specs, which is why I ignore them if I'm able to.
 

Isaac

Lifelong Learner
Local time
Today, 03:57
Joined
Mar 14, 2017
Messages
8,927
If you walk through the import text wizard, there is a screen where you can click something like Advanced ... there you can examine every bit of the specification and adjust accordingly, and then Save them. One tip...don't forget the name you saved it with.
 

namliam

The Mailman - AWF VIP
Local time
Today, 12:57
Joined
Aug 11, 2003
Messages
11,695
The import export manager is bugged; if you run it enough times eventually it will fail ... fortunately the workaround is easy, restart the database but its painfull.

If you want a guaranteed working solution which is faster to boot, research "open"-ing a file manually and processing it from there.
 

Users who are viewing this thread

Top Bottom