Results 1 to 5 of 5
  1. #1
    NHKRISHNA is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    Dec 2020
    Posts
    2

    How can i Import XML data according to params


    Hi,
    I have XML data with attributes like following example

    <?xml version="1.0" encoding="UTF-8"?>
    <PrintLetterBarcodeData

    uid="59456896564" name="Enosh" gender="M"
    yob="1992" co="S/O John" house="SPLD-986" street="XXXXX"
    loc="X COLONY" vtc="Xvillage" po="P.V.Township" dist="XDist"
    state="XSate" pc="568656">

    I want to split the data and want get each attribute like name, id, dob etc. How can I do this?
    (or) Split/parsing each attribute to a Table....
    Plz help.

  2. #2
    Micron is offline Very Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    13,372
    IMO you would need a complete table of tag words and loop through them. This is just off the top of my head:

    For each tag word in the table I'd determine the position in the string where the tag starts. Using that value, I would then start from that position and find the first " and store that value. Then do the same for the next " then use the mid function which can return the value of the word between the quotes. Then do something with the result. Then move to the next table record. Rinse and repeat.

    If you Google this, you might find that someone has already written code for it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    6,267
    Indeed they have?
    Just with a quick google https://fmsinc.com/microsoftaccess/m...Read_class.htm
    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

  4. #4
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,127
    Have you tried just importing the data into Access from an XML file using the import wizard?

    See Import XML Data into an Access Database | Database Solutions for Microsoft Access | databasedev.co.uk
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  5. #5
    alansidman's Avatar
    alansidman is offline Indifferent
    Windows 10 Access 2016
    Join Date
    Apr 2010
    Location
    Steamboat Springs
    Posts
    2,536
    You may find Power Query helpful in bringing your data into Excel, manipulating it as required and then loading into Access.

    Look at this link https://www.myexcelonline.com/blog/i...t-transform-2/

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

Similar Threads

  1. Import Linked Outlook Tasks Folder Doesn't Import All Data
    By Bkper087 in forum Import/Export Data
    Replies: 0
    Last Post: 11-19-2019, 12:06 AM
  2. Passing Params To Stored Procedure
    By jo15765 in forum Programming
    Replies: 3
    Last Post: 04-11-2017, 07:19 AM
  3. Replies: 13
    Last Post: 01-25-2016, 01:36 PM
  4. Select Query with lookup params passed from form
    By sariahdog in forum Queries
    Replies: 0
    Last Post: 07-18-2011, 09:10 AM
  5. Additional params for ANY query
    By dnagir in forum Access
    Replies: 0
    Last Post: 01-21-2009, 10:05 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