Exporting data to xml file

R

Raul Sousa

I need a button to export the result of an access query to an xml file.
This exported xml file must meet a predefined schema.
Is there a way access can export information meeting a predefined xml schema?
I have already searched for a solution. Based on my findings I created this
code, to export the data.
Private Sub Comando0_Click()
Dim fXMLPath As String
fXMLPath = "C:\Users\Raul\Documents\testxml.xml"
ExportXML acExportQuery, "testquery", fXMLPath
End Sub
I thought to export the data first, with any particular schema. After that I
will try to meet the given schema.
The problem with this code is that it does not export any data. This is the
result:
<?xml version="1.0" encoding="UTF-8" ?>
<dataroot xmlns:eek:d="urn:schemas-microsoft-com:eek:fficedata"
generated="2008-03-10T18:34:31" />

Any ideas why is it not exporting data?
Does anyone have a better solution?
 
G

gllincoln

Hi Raul,

Take a look at the query - does it contain data? Your output looks a lot
like what an 'empty' recordset export produces.

Just in case it requires fully qualified syntax...

Try restating your export line this way...

Application.ExportXML ObjectType:= acExportQuery, DataSource:="testquery",
DataTarget:=fXMLPath

Hope this helps,
Gordon
 
R

Raul Sousa

Hello,
Thank you for your reply.
My query contains data. it contains 3 results. i choose a smal query for
this test.

I tried to restat it like you sugested, but it produced the same result.


"gllincoln" escreveu:
 
N

noreply@noreply

Fedor is eager, but he needs to consistently oppose major opponents, and in past period he hasn't through that.But in any event, it now silkroad gold[/url:2rga7bsv] appears credible that Fedor give promote for Envisage on New Assemblage's Eve, and not for Affliction in January. So where does Affliction go fro (http://www.ugamegold.com/silkroad-online-gold/:2rga7bsv)?
 

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