473,387 Members | 1,637 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Import XML File to a MS Access Table

hi guys,

I am wanting to import an XML file into MS Access Table - can someone assist in guiding me through the VBA to create the import.

I have some experience in VBA writing Functions,Procedures etc but XML is new to me.
Attached Files
File Type: txt test.txt (73.4 KB, 1376 views)
Nov 20 '13 #1
4 12479
ADezii
8,834 Expert 8TB
Assuming you are using the correct Access Version, this will do the trick for you:
Expand|Select|Wrap|Line Numbers
  1. 'Import Options:
  2. 'acAppendData
  3. 'acStructureOnly
  4. 'acStructureAndData
  5.  
  6. Application.ImportXML DataSource:="<PATH to *.xml File>", ImportOptions:=acStructureAndData
Nov 20 '13 #2
thank you - I did try this and it does work for a basic XML file i.e. I can successfully load a file that I created.

The issue is that the XML file comes from another system and I believe it needs to be parsed. From my searching it appears this can be done using MSXML, however I cannot seem to get it working in Access. I suspect I need a library reference loaded but not sure which one I need.

When I put the following statement into my procedure:

Dim oDoc As MSXML.DOMDocument

I get an error saying User Defined Type not defined.



@ADezii
Nov 21 '13 #3
This topic is fortuitous for me. I just started to create a module for input and parsing an xml file.
I got the xml loaded into objects in memory now I need to extract data from it. I am going to study xmldom at ‘A Beginner's Guide to the XML DOM’ at http://msdn.microsoft.com/en-us/library/aa468547.aspx to see if this will make it easier.
I believe the library reference to msxml is 'Microsoft XML, v6.0' (this is latest version on windows 7, 64 bit machine).
Or late bind with Set objParser = CreateObject( "Microsoft.XMLDOM" )
Nov 21 '13 #4
I have solved the problem. I will post my code in a few hours
Nov 21 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Doug Baroter | last post by:
Hi, One of my clients has the following situation. They use Access DB for data update etc. some business functions while they also want to view the Access data quickly and more efficiently in...
2
by: Bob C. | last post by:
Question: Why would I not be able to import an Access 97 table in which some records have null values in fields that allow null values? Wouldn't the table's design be imported first, bringing...
3
by: Phil Rutter | last post by:
Hello All, I have about 700 word documents that have 2 tables one is static 4 colums x 5 rows the other is 5 colums x rows ranging from 2 to 100 what i wolud like to do is open the word doc....
1
by: Fred | last post by:
Hi. How do I import while mapping an excel table to an access table please??? I've searched around and all I can find is a software product or code that does the same thing as the access...
6
by: Paul | last post by:
I was wondering if anyone has had an issue where using vba code to read an excel file and import the data into an access table some records are not imported from the excel file. It seems looking at...
2
by: amy | last post by:
Hi, all: i am a new end user of access, now I have many excel files need to import to One table in access (combine all excel files into one table in excel). In excel files, some columns will have...
11
by: kaisersose1995 | last post by:
Hi, I've got an import procedure working, using a standard import specification to import a .csv file into a temporary table. The problem i'm having is that i have 4 different sets of borrower...
1
by: SAHMAD | last post by:
how can i import ms access table to oracle
15
by: OfficeDummy | last post by:
Hello all! I searched the Internet and this forum for a similar problem, but I found no help... Also, I'm a complete newbie to the fascinating world of programming, VBA and Access, so my question...
6
by: provor | last post by:
Hello, I have the following code that I am using when a user presses a button to import an excel file into a table. The code is hard coded to point to the correct table. This works great for this...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.