Problem retrieving XML from Sql server.

  • Hi guys,

    I always trying to program an asp page that could save the result of an sql query through an URL in a file.

    the URL would be like that "http://server/directory/template.xml"

    the result is an xml file that is shown in the browser.

    can i create an asp(or whatever) file that saves automatically the xml file without showing it in the browser ?

     Thanks & regards.

     

  • Hi guys,

    I got it done using VBScript, below is the code.

    dim conn

    dim R

    dim F

    dim fs

    const adPersistXML = 1

    set conn = Server.CreateObject("ADODB.Connection")

    conn.open (application("connstring"))

    set R = Server.CreateObject("ADODB.Recordset")

    R.Open "SELECT * FROM owner.table ORDER BY sort_field",conn

    set fs = server.CreateObject("Scripting.FileSystemObject")

    if fs.FileExists(server.MapPath("xmlfile.xml")) then

    fs.DeleteFile server.MapPath("xmlfile.xml")

    end if

    call R.Save(server.MapPath("xmlfile.xml"), adPersistXML)

     

    I have my stylesheet (XSL) also in the same path and hence am able to use that for displaying the result.

    Thanks for all the inputs and guidance.

    Sanjay

     

Viewing 2 posts - 16 through 16 (of 16 total)

You must be logged in to reply to this topic. Login to reply