Results 1 to 4 of 4
  1. #1
    PeterG is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    5

    How can I import long text with line breaks from .XML


    Hi All, I'm a forum newbie with no real Access experience so sorry if this has been covered. I am trying to create an ultra simple document management system for letters generated by a legacy system about to be replaced. I have created a table with 3 fields - letterSubject (number),letterDateTime & letterBody (long text). I have generated an XML file where the root element matches my table name and child elements match the column names; line breaks in letterBody are tagged <br/>. I have imported this into one long Word document but I need rapid access by subject and date range and some basic analytic capability. I imagined this would be straightforward to import into Access. I was wrong! With one-line letters and a short text body it behaves as I expected but with real letters and long text it won't play ball. Any ideas please? Thanks.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    8,345
    Did you try docmd.TransferSpreadsheet? I don't know if it works with XML.
    can you tru exporting the data to .TXT? Then docmd.TransferText.

  3. #3
    PeterG is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    5
    Quote Originally Posted by ranman256 View Post
    Did you try docmd.TransferSpreadsheet? I don't know if it works with XML.
    can you tru exporting the data to .TXT? Then docmd.TransferText.
    Thanks, I do also have the data as .TXT (I can easily get it into any flat file format - it's in 45 year old technology that I can understand!); I've never attempted docmd anything (I did say I was a newbie and I've always managed fine with the import dialog provided before the long-text gotcha got me)

    I will try to learn where and how to use docmd and let you know.
    Last edited by PeterG; 07-11-2020 at 03:55 PM.

  4. #4
    PeterG is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2020
    Posts
    5
    I've sussed it without needing to learn any strange and doubtless wonderful new language skills (for which I'm far too old). I changed the XML schema to use CDATA thus obviating the need for the <br/> that screwed things up. Bob is now my uncle.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 4
    Last Post: 06-11-2016, 07:07 AM
  2. Line Breaks Causing API Problems
    By djs79 in forum Access
    Replies: 5
    Last Post: 03-22-2016, 05:22 PM
  3. Replies: 14
    Last Post: 01-08-2015, 04:50 PM
  4. Export Fixed Width with No Line Breaks/Carriage Returns
    By jpfulton248 in forum Import/Export Data
    Replies: 5
    Last Post: 01-17-2014, 12:41 PM
  5. Eliminate line breaks in exported report
    By thekruser in forum Reports
    Replies: 3
    Last Post: 09-28-2010, 08:57 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums - Senior Forums