Importing / Exporting XML

M

Mike P

Hello

I wish to generate an XML file from a single table. Is there anything already in Access to do that or a VB function I can call? Also, I am going to want to import an XML file to. Is there anything in Access to do that – provided the XML tags match the Access record field names, and the data is going into one table

I am new to Access

Thanks
Mike P
 
J

Joe Fallon

A2003 handles XML very well. (They had more time to work on it.)
Support for XML gets worse as you go back in time.

So it depends on what version of Access you have.

Access imports its own exported XML data perfectly.
Other types of XML may work - I have not tried.

I wrote a VB function in A97 to do it.
Very complex but not impossible.

One more tip:

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

--
Joe Fallon
Access MVP



Mike P said:
Hello,

I wish to generate an XML file from a single table. Is there anything
already in Access to do that or a VB function I can call? Also, I am going
to want to import an XML file to. Is there anything in Access to do that -
provided the XML tags match the Access record field names, and the data is
going into one table?
 

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