how to import xml files

eatraas

Registered User.
Local time
Today, 15:01
Joined
Jan 23, 2009
Messages
96
Hi,

i've got an xml file which needed to imported into a database , the format is like :

<?xml version="1.0" encoding="iso-8859-1" ?>
- <VESSELS>
<vessel MMSI="244660460" TIME="2011-06-14 07:57:14 GMT" LONGITUDE="3.93711" LATITUDE="51.37476" COG="50" SOG="11.2" HEADING="511" NAVSTAT="0" IMO="" NAME="" CALLSIGN="" TYPE="" A="" B="" C="" D="" DRAUGHT="0" DEST="" ETA="00-00 00:00" />

<vessel MMSI="538090257" TIME="2011-06-14 08:03:36 GMT" LONGITUDE="-5.40183" LATITUDE="36.1025" COG="139" SOG="0.1" HEADING="13" NAVSTAT="1" IMO="9225794" NAME="SAG WESTFALEN" CALLSIGN="V7KV5" TYPE="71" A="149" B="47" C="15" D="15" DRAUGHT="8.1" DEST="ALGECIRAS" ETA="06-08 17:00" />


I've noticed that excle is not a big problem , but how can i do this bij using vba to get it in access ?
The standard import way gives me emty tables , not even showing the fields.

Thanks in advance

Erwin
 
What version of Access are you using? I've got 07 and have just imported a sample XML fine....
 
i've tried both 03 and 07 with this file and both went wrong. I can try 2010 as well and will do this.

It looks like the iso comment/method is causing this.

Can you confirm that your filr has the same structure ??

Regards
Erwin
 
I have used the DOM document model to import a XML, but this needs a lot of code.

If you are expert you can write a XLSLT to map the imput file.

I am not sure how native importXML procedures work
 
I just googled "Sample XML file" and downloaded thef irst on that came up, it was fro the MS website...
 
1. Make the corresponding table by hand (if you don¨t have it already).
2. Insert one line of correct data by hand.
3. EXport the table to XML - I think you can export the dataschema/types also in one of the options
4. Compare output with what you have.
 
here's how I did it...I went to MS website and looked for the XML reader, but this require a lot of programming...

good luck!
 

Users who are viewing this thread

Back
Top Bottom