Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exporting access 2k db to xml

Status
Not open for further replies.

hotreca

Technical User
Nov 19, 2002
25
DE
hi
I'm trying to export a access 2k db as a xml file in the format below using vba as I need to process the file and that does not work when i use the namespaces

<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<dataroot xmlns:eek:d=&quot;urn:schemas-microsoft-com:eek:fficedata&quot; xmlns:xsi=&quot; xsi:noNamespaceSchemaLocation=&quot;filename.xsd&quot;>
<parent>
<child1>bla</child1>
<child2>bla bla</child2>
<child3>bla bla bla</child3>
</parent>
<parent>
<child1>bla</child1>
<child2>bla bla</child2>
<child3>bla bla bla</child3>
</parent>
</dataroot>


or even better as
<?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?>
<root>
<parent>
<child1>bla</child1>
<child2>blabla</child2>
<child3>blablabla</child3>
</parent>
<parent>
<child1>bla</child1>
<child2>blabla</child2>
<child3>blablabla</child3>
</parent>
</root>



any help would be apreciated
 
Use an ADO recordset and the SaveAs method to save it as an XML file.

-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
thks scking,

I have one problem still I can't export NULL values from the db how do I go about those ( by NULL I mean rs which do not have values

hotreca
 
When I worked with exporting to XML it was a couple years ago and that was a problem I had also. My understanding is that Microsoft was going to correct that. Have you checked the Microsoft Knowledgebase for articles about this particular issue? I never experimented but if you replaces all null values with an empty string would that make a difference?

-------------------------------------
scking@arinc.com
Try to resolve problems independently
Then seek help among peers or experts
But TEST recommended solutions
-------------------------------------
 
thks scking

I worked around it by creating a error and then continue the loop on error null and empty strings are equal this has only been resolved in office xp with the exportXML method

cheers
and thanks for your trouble
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top