469,636 Members | 1,766 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,636 developers. It's quick & easy.

transfertext acimportdelim/acexportdelim problem with field names

Hi,

i want to export a table for later import, using vba.

Thatīs my code:
export:

filename = "C:\HVOtabelle.txt"
DoCmd.TransferText acExportDelim, , "tblHVOMaske1", filename

import:

filename = "C:\HVOtabelle.txt"
DoCmd.TransferText acImportDelim, , "tblHVOnew", filename

so i got a new table called tblHVOnew, which should be identical with
tblHVOMaske1 (no, i donīt want to just copy the table, i need this for
further treatment)
But only the first fieldname has been imported with its right name. It
is called "Einsatznummer". All the others are now called F1,F2,F3,...
until the fields end, but the got different names.
I also tried with

DoCmd.TransferText acExportDelim, , "tblHVOMaske1", filename, true
and
DoCmd.TransferText acImportDelim, , "tblHVOnew", filename,true

but i get the same strange result, that access gives my imported table
wrong field names

any ideas?

regards, Oli
Nov 13 '05 #1
3 8974
Oliver Gabriel wrote:
Hi,

i want to export a table for later import, using vba.

Thatīs my code:
export:

filename = "C:\HVOtabelle.txt"
DoCmd.TransferText acExportDelim, , "tblHVOMaske1", filename

import:

filename = "C:\HVOtabelle.txt"
DoCmd.TransferText acImportDelim, , "tblHVOnew", filename

so i got a new table called tblHVOnew, which should be identical with
tblHVOMaske1 (no, i donīt want to just copy the table, i need this for
further treatment)
But only the first fieldname has been imported with its right name. It
is called "Einsatznummer". All the others are now called F1,F2,F3,...
until the fields end, but the got different names.
I also tried with

DoCmd.TransferText acExportDelim, , "tblHVOMaske1", filename, true
and
DoCmd.TransferText acImportDelim, , "tblHVOnew", filename,true

but i get the same strange result, that access gives my imported table
wrong field names

any ideas?

regards, Oli


Why don't you recreate the text specification file? When you export,
you can set it to display the fieldnames in the first row.

When you import, it should recognize the field names as the first row.
You can also click Advanced and enter the field names etc.

You should always remember to save your specifications after you have
updated them.
Nov 13 '05 #2
Salad wrote:
Oliver Gabriel wrote:
Hi,

i want to export a table for later import, using vba.

Thatīs my code:
export:

filename = "C:\HVOtabelle.txt"
DoCmd.TransferText acExportDelim, , "tblHVOMaske1", filename

import:

filename = "C:\HVOtabelle.txt"
DoCmd.TransferText acImportDelim, , "tblHVOnew", filename

so i got a new table called tblHVOnew, which should be identical with
tblHVOMaske1 (no, i donīt want to just copy the table, i need this for
further treatment)
But only the first fieldname has been imported with its right name. It
is called "Einsatznummer". All the others are now called F1,F2,F3,...
until the fields end, but the got different names.
I also tried with

DoCmd.TransferText acExportDelim, , "tblHVOMaske1", filename, true
and
DoCmd.TransferText acImportDelim, , "tblHVOnew", filename,true

but i get the same strange result, that access gives my imported table
wrong field names

any ideas?

regards, Oli

Why don't you recreate the text specification file? When you export,
you can set it to display the fieldnames in the first row.

When you import, it should recognize the field names as the first row.
You can also click Advanced and enter the field names etc.

You should always remember to save your specifications after you have
updated them.


i am not sure i understand what you mean. the "true" in
do.CmdTransferText means that the first row are field names. but this
only works fine with the export.

regards, oli
Nov 13 '05 #3
Oliver Gabriel wrote:
Salad wrote:
Oliver Gabriel wrote:
Hi,

i want to export a table for later import, using vba.

Thatīs my code:
export:

filename = "C:\HVOtabelle.txt"
DoCmd.TransferText acExportDelim, , "tblHVOMaske1", filename

import:

filename = "C:\HVOtabelle.txt"
DoCmd.TransferText acImportDelim, , "tblHVOnew", filename

so i got a new table called tblHVOnew, which should be identical with
tblHVOMaske1 (no, i donīt want to just copy the table, i need this
for further treatment)
But only the first fieldname has been imported with its right name.
It is called "Einsatznummer". All the others are now called
F1,F2,F3,... until the fields end, but the got different names.
I also tried with

DoCmd.TransferText acExportDelim, , "tblHVOMaske1", filename, true
and
DoCmd.TransferText acImportDelim, , "tblHVOnew", filename,true

but i get the same strange result, that access gives my imported
table wrong field names

any ideas?

regards, Oli


Why don't you recreate the text specification file? When you export,
you can set it to display the fieldnames in the first row.

When you import, it should recognize the field names as the first row.
You can also click Advanced and enter the field names etc.

You should always remember to save your specifications after you have
updated them.

i am not sure i understand what you mean. the "true" in
do.CmdTransferText means that the first row are field names. but this
only works fine with the export.

regards, oli


Ok, thanks... i got you and it works fine!!
regards, Oli
Nov 13 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Vladislav Moltchanov | last post: by
4 posts views Thread by khutch | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.