transfertext acimportdelim/acexportdelim problem with field names

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Oliver Gabriel

    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.TransferT ext acExportDelim, , "tblHVOMask e1", filename

    import:

    filename = "C:\HVOtabelle. txt"
    DoCmd.TransferT ext 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.TransferT ext acExportDelim, , "tblHVOMask e1", filename, true
    and
    DoCmd.TransferT ext acImportDelim, , "tblHVOnew" , filename,true

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



    any ideas?

    regards, Oli
  • Salad

    #2
    Re: transfertext acimportdelim/acexportdelim problem with field names

    Oliver Gabriel wrote:
    [color=blue]
    > Hi,
    >
    > i want to export a table for later import, using vba.
    >
    > That´s my code:
    >
    >
    > export:
    >
    > filename = "C:\HVOtabelle. txt"
    > DoCmd.TransferT ext acExportDelim, , "tblHVOMask e1", filename
    >
    > import:
    >
    > filename = "C:\HVOtabelle. txt"
    > DoCmd.TransferT ext 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.TransferT ext acExportDelim, , "tblHVOMask e1", filename, true
    > and
    > DoCmd.TransferT ext acImportDelim, , "tblHVOnew" , filename,true
    >
    > but i get the same strange result, that access gives my imported table
    > wrong field names
    >
    >
    >
    > any ideas?
    >
    > regards, Oli[/color]

    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.

    Comment

    • Oliver Gabriel

      #3
      Re: transfertext acimportdelim/acexportdelim problem with field names

      Salad wrote:[color=blue]
      > Oliver Gabriel wrote:
      >[color=green]
      >> Hi,
      >>
      >> i want to export a table for later import, using vba.
      >>
      >> That´s my code:
      >>
      >>
      >> export:
      >>
      >> filename = "C:\HVOtabelle. txt"
      >> DoCmd.TransferT ext acExportDelim, , "tblHVOMask e1", filename
      >>
      >> import:
      >>
      >> filename = "C:\HVOtabelle. txt"
      >> DoCmd.TransferT ext 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.TransferT ext acExportDelim, , "tblHVOMask e1", filename, true
      >> and
      >> DoCmd.TransferT ext acImportDelim, , "tblHVOnew" , filename,true
      >>
      >> but i get the same strange result, that access gives my imported table
      >> wrong field names
      >>
      >>
      >>
      >> any ideas?
      >>
      >> regards, Oli[/color]
      >
      >
      > 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.[/color]

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

      regards, oli

      Comment

      • Oliver Gabriel

        #4
        Re: transfertext acimportdelim/acexportdelim problem with field names

        Oliver Gabriel wrote:[color=blue]
        > Salad wrote:
        >[color=green]
        >> Oliver Gabriel wrote:
        >>[color=darkred]
        >>> Hi,
        >>>
        >>> i want to export a table for later import, using vba.
        >>>
        >>> That´s my code:
        >>>
        >>>
        >>> export:
        >>>
        >>> filename = "C:\HVOtabelle. txt"
        >>> DoCmd.TransferT ext acExportDelim, , "tblHVOMask e1", filename
        >>>
        >>> import:
        >>>
        >>> filename = "C:\HVOtabelle. txt"
        >>> DoCmd.TransferT ext 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.TransferT ext acExportDelim, , "tblHVOMask e1", filename, true
        >>> and
        >>> DoCmd.TransferT ext acImportDelim, , "tblHVOnew" , filename,true
        >>>
        >>> but i get the same strange result, that access gives my imported
        >>> table wrong field names
        >>>
        >>>
        >>>
        >>> any ideas?
        >>>
        >>> regards, Oli[/color]
        >>
        >>
        >>
        >> 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.[/color]
        >
        >
        > i am not sure i understand what you mean. the "true" in
        > do.CmdTransferT ext means that the first row are field names. but this
        > only works fine with the export.
        >
        > regards, oli[/color]

        Ok, thanks... i got you and it works fine!!


        regards, Oli

        Comment

        Working...