Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Access 2007 xml import

Posted on 2014-07-30
3
Medium Priority
?
561 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 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

The Windows Phone Theme Colours is a tight, powerful, and well balanced palette. This tiny Access application makes it a snap to select and pick a value. And it doubles as an intro to implementing WithEvents, one of Access' hidden gems.
Traditionally, the method to display pictures in Access forms and reports is to first download them from URLs to a folder, record the path in a table and then let the form or report pull the pictures from that folder. But why not let Windows retr…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Suggested Courses

824 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