none
Trying to Export Long Text from Access to Pipe Delimited Text File. RRS feed

  • Question

  • Trying to Export Long Text from Access to Pipe Delimited Text File. 

    Users have input more than 255 characters into these fields, but view at table level, and export, only shows 255 characters.

    Is there a way to export these without truncating?

    NOTE:  on my query I use len([fieldname]) and it shows 500 characters, but even when opening the table it shows 255 characters; but form view shows more the 500 characters.  Cannot export to txt without truncating. Tried grabbing onto it with ADODB and DAO. Also, put into a 2010 DB.  No luck.

    If I grab it from the Form I get all the characters.

    Public Sub test()
    Z = Form_Permit2.Permitcomment.Value
    E = Len(Z)   'This gets all characters over 255.  Maybe I'll export to a text file, by looping through the Form object? Any other ideas?
    End Sub




    • Edited by FirmsAFTM Wednesday, April 11, 2018 4:57 PM
    Wednesday, April 11, 2018 4:17 PM

All replies

  • Hi,

    Just a quick stab in the dark, if your table field has anything in the Format property, try taking it out.

    Hope it helps...

    Wednesday, April 11, 2018 4:41 PM
  • Thanks.  Format property is blank.
    Wednesday, April 11, 2018 4:45 PM
  • Hmm, the only other time I've heard of a problem with Long Text fields was in what I described in this article. I can't think of why viewing the table would be truncated.

    I'll let you know if I find anything else.

    Wednesday, April 11, 2018 4:49 PM
  • Thank you
    Wednesday, April 11, 2018 4:50 PM
  • Hi,

    So far, I haven't found anything different than what we already know. Are you able to share a copy of your database?

    Wednesday, April 11, 2018 5:50 PM
  • Hi FirmsAFTM,

    You had mentioned that,"Trying to Export Long Text from Access to Pipe Delimited Text File.  Users have input more than 255 characters into these fields, but view at table level, and export, only shows 255 characters.Is there a way to export these without truncating?"

    I try to make a dummy table and store long text. then I use code below to export it to text file and it export all the text successfully.

    Data stored in table:

    Data display on form with its length:

    Output in text file:

    Code:

    Private Sub Command6_Click()
    Call ExportToText
    End Sub
    Sub ExportToText()
    Dim rst As DAO.Recordset
    Open "C:\Users\v-padee\Desktop\names.txt" For Output As #1
    Set rst = CurrentDb.OpenRecordset("SELECT field1 FROM Table1", dbOpenSnapshot)
    Do While Not rst.EOF
        Print #1, rst!field1
        rst.MoveNext
    Loop
    rst.Close
    Set rst = Nothing
    Close #1
    End Sub
    

    You can try to make a test on your side and try to post the result here.

    We will try to provide you further suggestions, if needed.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, April 12, 2018 2:06 AM
    Moderator
  • Hi FirmsAFTM,

    Is your issue is solved now?

    I find that you did not done any follow up for a long time.

    If your issue is fixed by you then I suggest you to post your solution and mark it as an answer.

    If your issue is still exist then try to refer the suggestions given by the community members.

    If you think that the suggestions given by the community member can solve your issue then mark the helpful suggestion as an answer.

    It will help us to close this thread and it also can be helpful to other community members who will meet with same kind of issues in future.

    If you have any further questions then you can let us know about it, We will try to provide you further suggestions to solve it.

    I suggest you to update the status of this thread and take appropriate actions to close it.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Thursday, April 26, 2018 9:29 AM
    Moderator