Solved

How to import XML data from Memo field or String expression into Access.

Posted on 2006-11-29
3
222 Views
Last Modified: 2011-10-03
How do I  transform XML data from a memo field (or string expression) to corresponding fields in my access table?

Sample XML Data from memo field:

<?xml version="1.0" encoding="utf-16"?>
<AddressBook>
   <Address>
      <ID>-1</ID>
      <FirstName>Jim</FirstName>
      <LastName>Anderson</LastName>
      <CompanyName>Acme Corp</CompanyName>
      <StreeLine1>123 1st Ave</StreeLine1>
      <StreetLine2>suite 100</StreetLine2>
      <City>Edina</City>
      <StateName>Minnesota</StateName>
   </Address>
</AddressBook>

0
Comment
Question by:caramelcooker
  • 2
3 Comments
 
LVL 44

Accepted Solution

by:
Leigh Purvis earned 125 total points
ID: 18036634
You could save the text in your field as a file - and use the inbuilt import method to grab the data.
(If in Access 2002/2003/2007).

Or you could load the text in code and use the MSXML object library to do it the more controlled way.
A pretty generic example of which is here
http://www.experts-exchange.com/Q_21990088.html
0
 
LVL 44

Expert Comment

by:Leigh Purvis
ID: 18040078
Need anything further or is that enough to be going on with?

Want an example of the first method - or have you gone with door number 2? :-)
0
 

Author Comment

by:caramelcooker
ID: 18040193
2nd option is the cleanest.  

I will build a table with the field names necessary and enumerate through their names having the results go to the sample code at the link you provided which will ultimately end up as the data for those fields.  MSXML6.0 it is!  Thank You for a timely response.
0

Featured Post

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In earlier versions of Windows (XP and before), you could drag a database to the taskbar, where it would appear as a taskbar icon to open that database.  This article shows how to recreate this functionality in Windows 7 through 10.
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

680 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question