Export to XML

L

Leslie Isaacs

I am using A2K, and need to export data as an XML file. Is
there a (reletively!) simple way to do this - I don't have
XML experience?
Thanks
Les.
 
J

John Nurick

Hi Leslie,

As far as I can remember XML support began with Access 2002. So the
simplest approach may just be to upgrade to Access 2003 (where it's much
improved).

Otherwise, there may be some third party software out there. Otherwise,
it's not that a big programming job to write VBA code that generates a
simple XML file from a particular table or query.
 
J

Joe Fallon

XML files can be easily created using Microsoft's ADO Recordset object and
saving it as an XML file. The sample code below shows how an Access 2000
query can be opened and saved as an XML file.

Sub SaveQueryToXMLFile(qryName As String)
Dim conn As New ADODB.Connection
Dim rst As New ADODB.Recordset
Set conn = Application.CurrentProject.Connection
With rst
.Open qryName, conn, adOpenDynamic, adLockOptimistic
.Save "c:\Folder1\Folder2\" & qryName & ".xml", adPersistXML
.Close
End With
End Sub
 

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