Results 1 to 8 of 8
  1. #1
    Join Date
    Jun 2024
    Posts
    5

    XML Field Conversion

    I have an ODBC connection in Access to a SQL Server database table. The ColumnsUpdated field comes in as Long Text data type. I need to query this field to extract records with a specific text string (CompletedDate) that can be anywhere within the field.



    When I try adding the criteria Like "*CompletedDate*" and run, I receive an ODBC - call field error that the Argument data type xml is invalid for argument 1 or like function.

    The field output is greater than 255 characters. How do I convert the long text/xml data type to be able to query the field based on needed criteria?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Well firstly you have not included any * for the Like, so I doubt that would work anyway? Perhaps try with *?
    You couldalso try Instr() ?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    Join Date
    Jun 2024
    Posts
    5
    Thank you - I do actually have asterisks in my query - they got removed when I imported the text from Word. I will try the Instr()

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,556
    Quote Originally Posted by June7 View Post
    That is me out then.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Create a pass-through query. Use SQL from stackoverflow.com/questions/10344553/…. Worked for me.
    Or link to SQLServer view that parses the XML.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  7. #7
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,423
    Interesting - the page at the link has been removed.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows 11 Access 2021
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,770
    Assume you mean the cross-post. Yes, author deleted after I posted here.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Empty Field (Fieldname only) in .xml file
    By cheloto in forum Access
    Replies: 0
    Last Post: 04-17-2024, 08:59 AM
  2. Replies: 0
    Last Post: 02-21-2023, 07:11 AM
  3. Importing XML & Field Names
    By SummerCampGuy in forum Import/Export Data
    Replies: 2
    Last Post: 03-19-2018, 07:08 AM
  4. Ribbons XML code to long for one text field
    By sstrauss87 in forum Access
    Replies: 3
    Last Post: 12-22-2011, 03:46 PM
  5. Access export currency field to XML
    By pfarnell in forum Import/Export Data
    Replies: 1
    Last Post: 11-29-2011, 01:46 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