[xsl] Display problems from asp file.

Subject: [xsl] Display problems from asp file.
From: "Bysouth, Sam" <Sam.Bysouth@xxxxxxxxxxxxxx>
Date: Fri, 9 May 2003 11:57:07 +1000

I am trying to save a query result from an Access database as xml using the
following code. It retrieves the data fine, but is unable to interpret the
xml fully. This is very frustrating!! An html page calls the asp page below.
I am running IIS 6.0.

Any ideas on what I am doing wrong??



<%@ Language=VBScript %>

' Generate the correct HTTP headers to signify that this is an XML stream 
Response.ContentType = "text/xml"
Response.Expires = 0
<?xml version="1.0"?>
dim strConn, strSQL, objRS

' Generate the OLE DB connection string
strConn = "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & _

' Retrieve the SQL statement
strSQL = Request( "txtSQL" )

' Create the ADO Recordset object
set objRS = Server.CreateObject( "ADODB.Recordset" )
objRS.Open strSQL, strConn 

' Save the ADO recordset to the HTTP response stream

' Note that we have a conditional here to allow this sample to run using
' IIS 4.0 and IIS 6.0

if Request.ServerVariables( "SERVER_SOFTWARE" ) = "Microsoft-IIS/6.0" then
	objRS.Save Response, adPersistXML 
	dim objFS, strFilename, strTempFolder, objTextStream
	set objFS = Server.CreateObject( "Scripting.FileSystemObject" )
	strTempFolder = objFS.GetSpecialFolder( TemporaryFolder ) + "\"
	strFilename = objFS.GetTempName()
	objRS.Save strTempFolder + strFilename, adPersistXML 
	set objTextStream = objFS.OpenTextFile( strTempFolder + strFilename,
ForReading ) 
	Response.Write objTextStream.ReadAll()	
	' NOTE: if you get a Permission Denied message here, you must edit
	' DACL for your winnt\temp folder to allow IUSR_MACHINENAME and 
	' IWAM_MACHINENAME to be able to delete temporary files created here
	objFS.DeleteFile strTempFolder + strFilename, False
end if


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list

Current Thread