By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,367 Members | 1,291 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,367 IT Pros & Developers. It's quick & easy.

transfertext acimportdelim/acexportdelim problem with field names

P: n/a
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
Share this Question
Share on Google+
3 Replies


P: n/a
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

P: n/a
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

P: n/a
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.