Solved

Import XML file into existing table and update the record

Posted on 2014-10-04
1
448 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
1 Comment
 
LVL 7

Accepted Solution

by:
Gauthier earned 500 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

The first two articles in this short series — Using a Criteria Form to Filter Records (http://www.experts-exchange.com/A_6069.html) and Building a Custom Filter (http://www.experts-exchange.com/A_6070.html) — discuss in some detail how a form can be…
It took me quite some time to sort out all the different properties of combo and list boxes available from Visual Basic at run-time. Not that the documentation is lacking: the help pages are quite thorough and well written. The problem was rather wh…
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now