Advertisement

05.15.2008 at 05:52AM PDT, ID: 23404841
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

9.3

How to run application.exportxml from VBScript in ASP

Asked by AME123 in Active Server Pages (ASP), Extensible Markup Language (XML), VB Script

Tags: ,

I have an application in ASP VBScript running on a web server using an Access 2003 database.  I need to export a table from that Access database to XML.

I jknow that the appropriate Access method is application.exportXML.  However, the way in which I have formatted the command in VBScript appears to be incorrect, as the command will not run: although I don't get an error message, no XML file is produced.  

Further details are as follows.

The ASP application is running on a web server, and the code is VBScript.  The database is Access2003.  The objective of the code is:

>  within ssrc.mdb , to create a table called xgeolog from a table called geolog (this works), and
>  to export the table called xgeolog as an XML file called xxrc.xml (this doesn't work).
 
Within Access this code DOES work:

Private Sub grabx_Click()
DoCmd.RunSQL "SELECT geolog.* INTO cwg_dl FROM geolog IN 'F:\data_webserver\geocoder_log.mdb'"
Application.ExportXML ObjectType:=acExportTable, DataSource:="cwg_dl", DataTarget:="F:\data_webserver\cwg_dl.xml"
End Sub
----------------------------
 
However, in ASP VBScript there's something wrong with the second last line (and maybe other lines that set it up):
thisdb = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = "& Server.MapPath("/database/ssrc.mdb")
set dbx  = server.createobject("adodb.connection")
dbx.open thisdb
set db_rs = dbx.execute("SELECT geolog.* INTO xgeolog FROM geolog")
set dax = server.CreateObject("Access.Application")
dax.ExportXML "ObjectType = acExportTable, DataSource =  xgeolog, DataTarget = "& Server.MapPath("/exports/xxrc.xml")
db_rs.close
----------------------------
 
Any ideas please?  Note that I have seen similar questions in Experts Exchange, but they have not been satisfactorily answered, and I believe that many people could use the answer to this question.Start Free Trial
1:
2:
3:
4:
5:
6:
7:
thisdb = "Provider = Microsoft.Jet.OLEDB.4.0; Data Source = "& Server.MapPath("/database/ssrc.mdb")
set dbx  = server.createobject("adodb.connection")
dbx.open thisdb
set db_rs = dbx.execute("SELECT geolog.* INTO xgeolog FROM geolog")
set dax = server.CreateObject("Access.Application")
dax.ExportXML "ObjectType = acExportTable, DataSource =  xgeolog, DataTarget = "& Server.MapPath("/exports/xxrc.xml")
db_rs.close
[+][-]05.15.2008 at 11:06PM PDT, ID: 21580335

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Active Server Pages (ASP), Extensible Markup Language (XML), VB Script
Tags: ASP VBScript, XML, Access 2003, Export XML
Sign Up Now!
Solution Provided By: bigjokey
Participating Experts: 1
Solution Grade: A
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628