[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Display problems from asp file.

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

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??

Thanks,

Sam


<!--TOOLBAR_START--><!--TOOLBAR_EXEMPT--><!--TOOLBAR_END-->
<%@ 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=" & _
          Server.MapPath("CacheDemo.mdb")


' 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
both
' IIS 4.0 and IIS 6.0

if Request.ServerVariables( "SERVER_SOFTWARE" ) = "Microsoft-IIS/6.0" then
	objRS.Save Response, adPersistXML 
else
	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()	
	objTextStream.Close()
	
	' NOTE: if you get a Permission Denied message here, you must edit
the
	' 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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.