XML data into MDB file

P

Preeti

Hi all

I am a newbie in xml.

I have a requirement where I have a predefined XML files and I want to
add the data in these file to into Access mdb through my application

The xml structure is fixed and I hav eto implement a button which on
click submit the data to the mdb file without any further intervention
from user.

My problems are ::

1) Since xml file structure is fixed but it can have multiple nested
elements in different files, the database in MDB should be relational.
I dont know how I can achieve this. How will I maintain multiple
tables in the target database??

for example ::

one file may contain blank data like this
<images>
</images>

and another xml file may contain

<images>
<imagename>
<caption></caption>
</imagename>
<imagename>
<caption></caption>
</imagename>
</images>

2) If in future the xml file is changed I will have to change my
application also.. I want to avoid this. Is there any way in which I
can make my application handle minor changes in xml structure
automatically ?? ( for instance adding fields in database dynamically
if new field is found in xml )

can anyone help??

Regards

Preeti
 
C

clintonG

JET does not support XML so you have to "shred" the data from the XML file.
This means you need a column in a table for every element in the XML file
and you may need to create foreign keys to relate to other tables if for
example an XML element also supports attributes. If the schema of your XML
file changes you are correct to understand you database must change. Really
FUBAR.

The alternative is SQL Server 2005 Express which is meant to replace JET.
I'm fairly certain both Express which is free and SQL Server 2005 itself
both now support XML as a native file type. SQL Server 2005 does for sure.
You can store the entire XML file in a table and not worry about changes to
the XML schema. Shredding may still be needed depending on circumstances but
many are just storing the entire XML file in the table so if and when the
XML schema changes the data base table does not have to also change.

I think the best advice from me or whomever would be to dump JET which is
exactly what Microsoft has done and will no longer support it as was
announced some time ago I recall. Don't ask me the details regarding when
JET will finally be discontinued as I don't know.

Finally, there's a microsoft newsgroup unique for issues concerning XML...

<%= Clinton Gallagher
NET csgallagher AT metromilwaukee.com
URL http://clintongallagher.metromilwaukee.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top