Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Import XML file into existing table and update the record

Posted on 2014-10-04
1
Medium Priority
?
579 Views
Last Modified: 2014-10-05
I have a XML and a XSD file on my desktop that I want to use to UPDATE an existing record in a table in my Access 2010 database.

What is the best way to achieve this?

--Steve
0
Comment
Question by:SteveL13
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 7

Accepted Solution

by:
Gauthier earned 2000 total points
ID: 40361393
http://msdn.microsoft.com/en-us/library/office/ff823157(v=office.14).aspx

The best way will depend on any integrity link from the table to update to the rest of your  database
Assuming we cannot temporarily delete that table or it's content, we have those solution:

BEST Solution (If you control the export process)
- Make the export/import from a temporary table copy you can delete safely.
step 1 Delete existing temporary table if it exists
step 2 Run the importXML with the parameter acStructureAndData.
step 3 Execute a simple update query.

If the table exist is the same name, cannot be deleted and the record to update also cannot be deleted beforehand:

importXML with acAppendData will fail (duplicate primary key)
importXML with acStructureAndData willproduce a new unknown to your code tablename.
you can work arround that in this way:

step 1 delete the importErrors (or count rows)
step 2 Make a list of existing table name.
step 3 Run the importXML with acStructureAndData
step 4 Compare current table name with earlier list.
step 5 Check the importErrors table.
step 6 Create an update query using the found name.
step 7 Run the update query
step 8 Delete the imported table.
step 9 Report any errors to the user.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

721 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