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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with "ExportXML Method"

Status
Not open for further replies.

hotreca

Technical User
Nov 19, 2002
25
DE
Hi every one!

My prob
I'm trying to export a qry from Access 2k as a .xml file and a .xsd (Schema) file using a button on a form. I tried the ExportXML Method but the catch is that no matter what I try the whole thing is exported as a .xml file in which the .xsd is included the file. The file is of no use to me in this form.
The code for the button I used is following.

Private Sub btn_XMLExport_Click()
Application.ExportXML _
ObjectType:=acExportQuery, _
DataSource:="qry_name", _
DataTarget:="d:\xmlData\qry_name.xml", _
SchemaTarget:="d:\xmlData\qry_name.xsd", _
SchemaFormat:=acSchemaXSD, _
OtherFlags:=1

MsgBox "XML Export complete!!", vbInformation
End Sub

[thumbsup]

Thanks in advance for any answers
 
try naming the Schema file as qry_nameSchema.xsd other wise the code is fine Remember amateurs built the ark - professionals built the Titanic

[flush]
 
Thanks for the answer
But I still get an error mesage when debugging
"Named argument not found"

greetings
hotreca
 
Using the
OtherFlags:=1 seems to cause the schema data to be put in the xml file in one test I did. Removing it or using 0 left the schema data only in the xsd file where it belongs.
Regards,
+BillJ
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top