473,322 Members | 1,540 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,322 software developers and data experts.

Importing nested XML structures into Access 2000

I am working on an Access 2000 database that imports a set-format XML
file for use in order printing.

At the moment it just imports the normal XML, but I want to be able to
import extra information as follows:
<OrderLineItem>
<ItemCode>40RP3</ItemCode>
<ItemSummary>Personalised Ribbons Over 1500 (each)
</ItemSummary>
<ItemQuantity>1500</ItemQuantity>
<ItemPrice>$0.40</ItemPrice>
<LineCharge>$600.00</LineCharge>
<ExtraDetail>
<DetailQuantity>1500</DetailQuantity>
<DetailSport>Participation</DetailSport>
<DetailAsPerPrevious>Yes</DetailAsPerPrevious>
<DetailPlace>1st</DetailPlace>
<DetailDateRequired>10-September-2005</DetailDateRequired>
</ExtraDetail>
</OrderLineItem>
What I am having trouble with is that when I try to get the routine to
import the information from the ExtraDetail node, it decides to import it
from every ExtraDetail node in the file and keeps looping.

Set objItemsExtra = objDoc.selectNodes
("//OrderItems/OrderLineItem/ExtraDetail")

For lngItemExtra = 1 To objItemsExtra.Length
Set objNode = objItemsExtra.Item(lngItemExtra - 1)
Set objItemExtra = objNode.firstChild

Do Until objItemExtra Is Nothing
rsOrderLineComments.AddNew
rsOrderLineComments!OrderLineItemID = lngOrderLineItemID
rsOrderLineComments!DetailName = Mid(objItemExtra.baseName, 7, Len
(objItemExtra.baseName))
rsOrderLineComments!DetailComments = objItemExtra.nodeTypedValue
Set objItemExtra = objItemExtra.nextSibling
rsOrderLineComments.Update
Loop

Next

For most of the other solutions I have looked at, there are only a set
number of attributes to retreive from the file. In this case the
ExtraDetail node may not even be present in the file (it is accessed via
a case statement) and the number of attributes can vary.

Thanks.
Nov 13 '05 #1
0 1162

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: OKB (not okblacke) | last post by:
For a variety of reasons, I'm interested in putting together some code that will allow me to created structures out of nested classes, something like: class class1: def methA(self): print...
1
by: R Jones | last post by:
All, I'm trying to automate the import of an XML document into an Access application. Unfortunately Access cannot properly read the document. When it attempts to bring in the document it...
3
by: Tcs | last post by:
My backend is DB2 on our AS/400. While I do HAVE DB2 PE for my PC, I haven't loaded it yet. I'm still using MS Access. And no, I don't believe this is an Access question. (But who knows? I...
1
by: D Mat | last post by:
Hi, I'm trying to get MS Access 2000 to automatically import a series of (~200) flat text, tab delimited, data files into a single Access table, with consistent fields and rows. The files have...
5
by: dixie | last post by:
If I sent a user an empty database container - dB with no tables and I needed them to import their tables into it and one of their tables was a hidden table with the prefix Usys, is there any way...
11
by: Alfonso Morra | last post by:
Hi, I have the ff data types : typedef enum { VAL_LONG , VAL_DOUBLE , VAL_STRING , VAL_DATASET }ValueTypeEnum ;
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: jfjavier | last post by:
How do I import nested XML document to sql server 2000? <Registrants> <Member> <ID>01</ID> <LName>Dou</LName> <FName>John</FName> <Questions>...
1
by: thadson | last post by:
Hi, I'm trying to import specific cells from MS Excel 2000 spreadsheets to MS Access 2000 tables then move the spreadsheets to a different directory. I'm very new to this and I'm having trouble...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.