View Full Version : automating export of XML


Dylan Snyder
03-06-2009, 04:46 PM
Is there any way to automate the export of an object from Access in XML Format? Is XML Supported in SendObject? tHanks in advance for your help

HiTechCoach
03-06-2009, 10:03 PM
What version of Access are you using?

This may help:
Download: Open XML Developer Map (http://www.microsoft.com/downloads/details.aspx?familyid=134BCB91-DD7B-4209-AC94-2699B9366874&displaylang=en)

Dylan Snyder
03-08-2009, 01:53 PM
We are on 2003

gemma-the-husky
03-09-2009, 02:20 AM
i ended up explicitly generating an xml file by writing print statments, based on iterating a recordset

Simon_MT
03-09-2009, 06:01 AM
2007 does have a function:


Function SiteMaptoXML()
Dim WebFile As String
WebFile = GetImageDir & "sitemap.xml"
Const CREATE_REPORTML = 16
Application.ExportXML _
ObjectType:=acExportReport, _
DataSource:="Site Maps Search", _
DataTarget:=WebFile, _
OtherFlags:=CREATE_REPORTML
End Function


Simon

Dylan Snyder
03-09-2009, 06:06 AM
thanks,
It may be time to upgrade. I'll try Gemma-the-husky's idea first, though. The days of our Department being on access are numbered, anyway. I would just allow the user to export using the menu commands, but I always feel scared allowing users to see anything other than the switchboard, reports, and forms.

Dylan Snyder
03-09-2009, 08:46 AM
I found this online - the page says that this code will work for 2003---and it's on the internet so it can't be wrong, right:)?

Just thought I'd post this if anyone encounters this thread and has the same problem as I do.

http://msdn.microsoft.com/en-us/library/aa221224(office.11).aspx

gemma-the-husky
03-09-2009, 09:47 AM
i will keep this for future reference

Dylan Snyder
03-09-2009, 02:58 PM
thanks for your help.

now, I just realized that I don't know anything about schemas and getting XML exported files in a certin format. I hunted on the forum, but could not find any good tutorial on getting started. Does anyone know of the top of their head the definitive "exporting XML from Access for dummies" Thread or tutorial?

gemma-the-husky
03-09-2009, 03:02 PM
all i did was got a well formed xml file of the type i wanted to end up with - and then wrote a module to generate one

i think it was recursive, as you cant generate the end tag until you generate the content of that tag.


this sort of logic

sub generatexml(node)

produce opentag
for each childnode
generatexml(childnode0
next
produce closetag

end sub