Solved

Access 2007 xml import

Posted on 2014-07-30
3
520 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
3 Comments
 
LVL 13

Expert Comment

by:Russell Fox
Comment Utility
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 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
Comment Utility
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
Comment Utility
Restarted my PC and it started working : )
0

Featured Post

Complete Microsoft Windows PC® & Mac Backup

Backup and recovery solutions to protect all your PCs & Mac– on-premises or in remote locations. Acronis backs up entire PC or Mac with patented reliable disk imaging technology and you will be able to restore workstations to a new, dissimilar hardware in minutes.

Join & Write a Comment

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
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…
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…

763 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

7 Experts available now in Live!

Get 1:1 Help Now