macro to import txt file concatenates headers?

S

Sybmathics

Hi all,

I have used the wizard to import a third txt file into an existing
table. Everything goes as it should.
However, when I want to create a macro that should do the actions the
wizard perfomrs correctly, everytime the error message appears stating
that there is no corresponding field. Taking a closer look at the
warning it seems that the macro first concatenates all headers in the
text file by adding an underscore between the headernames and then
ofcourse tells me that there is no corresponding field name in the
destination table.

Has anybody experienced something like this, and what could be the solution?

I need to solve this one quickly, because time is running out.

Any suggestion is greatly appreciated.

TIA,

Greets,


Sybolt
 
A

aaron.kempf

Access doesn't have wizards. And it is not an ETL tool

Move to DTS or SSIS if you give a crap about this invention called
'the future'

-Aaron
 
A

Arvin Meyer [MVP]

Most database systems do not allow spaces in table or field names. It is not
a good practice to do so. If you can alter your field names before
importation, that's the best solution, but if not, change your field names
so that the error no longer occurs.

Please ignore anyone trolling these newsgroups. They apparently know nothing
about Access, and little about databases in general. It appears that their
sole purpose is to misinform posters. Unfortunately, these newsgroups are
not actively monitored, or they would be banned.
 
A

aaron.kempf

Arvin;

I'm not trolling for shit.

I'm here to tell people to grow up, lose the training wheels.
And welcome to this great world called 'SQL Server'.

The time has come for you to STFU and stop attacking me, asshole.

-Aaron
 
D

developer

Arvin Meyer said:
Most database systems do not allow spaces in table or field names. It is
not a good practice to do so. If you can alter your field names before
importation, that's the best solution, but if not, change your field names
so that the error no longer occurs.
</cut>

Arvin,

I have a very simple txt file that looks like

name dept
john Sales
pete R&D
etc.

with tabs between field names, no spaces.

When ik run the wizard Get external data and import to an existing table
tblPersonnell with two fields
name dept
defined as text fields, everything is imported correctly.
Now, when I want to have a macro to do the same actions i get the message
Field name_dept does not exist in the destination table. Make sure that
fields have the same name.

Please inform me about the right settings for the macro.

greets,

Sybolt
 
Top