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

x
?
Solved

Access 2007 xml import

Posted on 2014-07-30
3
Medium Priority
?
553 Views
Last Modified: 2014-07-31
I'm trying to use application.importxml in Access but it just seems to crash when I run it: -

Dim Xfile As String
Xfile = "C:\Temp\20140717_13220817778969.XML"
Application.ImportXML Xfile, acAppendData

Open in new window

Also tried AcStructureandData option. Error trapping not working, can anyone help?
0
Comment
Question by:HKFuey
[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
3 Comments
 
LVL 13

Expert Comment

by:Russell Fox
ID: 40229781
Are you defining what acAppendData should be?
Dim Xfile As String
Dim Const acAppendData = 2
Xfile = "C:\Temp\20140717_13220817778969.XML"

Application.ImportXML Xfile, acAppendData

Open in new window

0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 1500 total points
ID: 40230190
This often occurs when the XML is malformed, or if Access cannot read it. For example, I believe Access expects there to be an outer element that refers to a table in your database.

IMO, you're much better off using the DOMDocument objects to work with XML. It does take more time to develop, but you have a LOT more control over the data. Here's a link that will help you to get started: http://www.databasejournal.com/features/msaccess/article.php/3310901/Import-XML-Data-Into-Microsoft-Access.htm
0
 

Author Closing Comment

by:HKFuey
ID: 40231350
Restarted my PC and it started working : )
0

Featured Post

Nothing ever in the clear!

This technical paper will help you implement VMware’s VM encryption as well as implement Veeam encryption which together will achieve the nothing ever in the clear goal. If a bad guy steals VMs, backups or traffic they get nothing.

Question has a verified solution.

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

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.
Code that checks the QuickBooks schema table for non-updateable fields and then disables those controls on a form so users don't try to update them.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
Suggested Courses

715 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