Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / SQL Server / ADP / May 2008

Tip: Looking for answers? Try searching our database.

Application.ExportXML

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Petr Jankovsky - 23 May 2008 15:48 GMT
Hello, I have a question about exporting xml using Access. I would like to
export XML data from stored procedure "procedure". This stored procedure have
one parameter "where", lets say
ALTER PROCEDURE procedure(@Where varchar(50)) as
Select * from table where ID = @Where

where table is valid table with column called ID.
I've tried Application.ExportXML acExportStoredProcedure, "procedure",
"C:\xml.xml"
If I run it, input box appears and asks for Where parameter. Is there any
way to pass that parameter via VBA?
Sylvain Lafontaine - 26 May 2008 18:12 GMT
The best way for you might be to directly use the ADO objects; something
like:

   Dim rs As ADODB.Recordset
   Set rs = New ADODB.Recordset

   rs.Open "EXEC test_ExportXML 63", CurrentProject.Connection
   rs.Save "C:\test.xml", adPersistXML

Signature

Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)

> Hello, I have a question about exporting xml using Access. I would like to
> export XML data from stored procedure "procedure". This stored procedure
[quoted text clipped - 8 lines]
> If I run it, input box appears and asks for Where parameter. Is there any
> way to pass that parameter via VBA?
Petr Jankovský - 26 May 2008 18:19 GMT
Great, that looks very good. I'm gonna try it soon:)

> The best way for you might be to directly use the ADO objects; something
> like:
[quoted text clipped - 18 lines]
>> If I run it, input box appears and asks for Where parameter. Is there any
>> way to pass that parameter via VBA?
Petr Jankovský - 27 May 2008 12:15 GMT
OK, this is working, thanks for solution. But I have another question: It is
possible to specify schema file for that output xml?

> The best way for you might be to directly use the ADO objects; something
> like:
[quoted text clipped - 18 lines]
>> If I run it, input box appears and asks for Where parameter. Is there any
>> way to pass that parameter via VBA?
Sylvain Lafontaine - 27 May 2008 18:04 GMT
Sorry, I don't know.  The only thing that I know is that you cannot call a
stored procedure with parameters with the Application.ExportXML method.

Another solution for you could be to use a form or a report to call the SP
and then use Application.ExportXML method on this form/report; however, I
never tried it personally.

Signature

Sylvain Lafontaine, ing.
MVP - Technologies Virtual-PC
E-mail: sylvain aei ca (fill the blanks, no spam please)

> OK, this is working, thanks for solution. But I have another question: It
> is possible to specify schema file for that output xml?
[quoted text clipped - 22 lines]
>>> any
>>> way to pass that parameter via VBA?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.