Solved

Access 2007 xml import

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

Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

Question has a verified solution.

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

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
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…
Familiarize people with the process of utilizing SQL Server functions 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 Ac…
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …

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

15 Experts available now in Live!

Get 1:1 Help Now