Results 1 to 5 of 5
  1. #1
    Lounger
    Join Date
    May 2003
    Location
    Whittier, California
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Truncated imported field (2000)

    Hello All,

    I have a text file that I import into Access. It has one potentially large field (comments from the user), so I import that into a memo field. This works fine if I import the file manually, but when I do it in VBA code using the DoCmd.TransferText method long entries still get truncated (looks like at 255 characters, although I haven't bothered to count). Any idea why this is happening?

    Kevin

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Truncated imported field (2000)

    I'm using Access 2002, not 2000. I just tested, and a field containing long text strings was imported intact as a memo field using DoCmd.TransferText. Perhaps someone else with Access 2000 can test? (You can easily create text files in different formats from Excel)

    By the way. what kind of text file do you have? Fixed width, delimited?

  3. #3
    3 Star Lounger
    Join Date
    Aug 2002
    Location
    Leuven, Vlaanderen, Belgium
    Posts
    322
    Thanks
    9
    Thanked 0 Times in 0 Posts

    Re: Truncated imported field (2000)

    Hey, Kevin,
    this reminds of various other threads about memo field problems... I'm sorry I can't help you, but I'll certainly watch what others might say...
    Except, just wondering, thinking out loud: is the text field shown entirely if you create a linked table to the text file? In that case you might be able to start copying the content from that linked table to the desired destination instead of the transfer text method... (even though I don't know if then no truncation will happen too...)

  4. #4
    Lounger
    Join Date
    May 2003
    Location
    Whittier, California
    Posts
    38
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Truncated imported field (2000)

    Hans, the text file is in delimited format.

    hasse, thanks, linking to the text file seems to do the trick. That is, as far as the memo field goes. However, the time field isn't working for some reason. The format for this field in the text file is "09:24:51 AM". All I see in the linked Access table is #Num!. I changed the format of this field to long time, but that didn't help. Is there an easy solution to this, or should I just change it to a text field and use a cdate function when I move the data into another table?

    Kevin

  5. #5
    Plutonium Lounger
    Join Date
    Dec 2000
    Location
    Sacramento, California, USA
    Posts
    16,775
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Truncated imported field (2000)

    If it is text, Access can't interpret it as time. A "time" field is just a date field with a time format and date fields are actually numeric, not text. To make that anything but a string, you'll have to convert it to a date/time.
    Charlotte

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •