Solved

Access 2007 xml import

Posted on 2014-07-30
3
527 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
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 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
A simple tool to export all objects of two Access files as text and compare it with Meld, a free diff tool.
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…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…

813 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

18 Experts available now in Live!

Get 1:1 Help Now