Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XML
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 1st, 2005, 05:50 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default writing to an xml file on the client side

ok .. I need help (once more)
I create a report in the following script fed by an Access Database.
My goal is to give the client the option to save this report as an xml file locally so it can update the clients Database (via import)
how do i write from the server to the clients harddrive? Is there a way to write directly to the clients harddrive? or do i create a file for download on the server?

Toran



<%option explicit%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
<head>
    <title>Client Report</title>

    <%
    dim objCommand, objRS
        Set objCommand = Server.CreateObject("ADODB.Command")
        objCommand.ActiveConnection = strConn
        objCommand.CommandText = "Select FirstName, Name, City, Sales.SalesID, SalesDate, SalesTime, Client.ClientID "
        objCommand.CommandText = objCommand.CommandText + "FROM Client, Sales, SalesLine "
        objCommand.CommandText = objCommand.CommandText + "WHERE Client.ClientID= Sales.ClientID AND Sales.SalesID= SalesLine.SalesID "
        'executing and resetting to Nothing
        objCommand.CommandType = adCmdText
        Set objRS = objCommand.Execute
        Set objCommand = Nothing
    %>
</head>

<body>
Sales Reports:
<%

response.write "<table border ='1'>"
response.write "<tr><th colspan='4'>Clients</th></tr>"
if not (objRS.eof) then

    objRS.moveFirst
    while not objRS.eof

    response.write "<tr><td>"&objRS("ClientID")&"</td><td>"&objRS("FirstName")&"</td><td>"&objRS("Name")&"</td><td>"&objRS("City")&"</td>"
    response.write "<td>"&objRS("SalesID")&"</td><td>"&objRS("SalesDate")&"</td><td>"&objRS("SalesTime")

    objRS.movenext
    wend

else

response.write "NOTHING HERE"
End if
response.write "</table>"
%>
</body>
</html>


... there is always more to learn...

... there is always more to learn...
__________________
... there is always more to learn...
Reply With Quote
  #2 (permalink)  
Old April 2nd, 2005, 05:32 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You can only wite to the hard drive if the client has low security settings and the code executes client side. An alternative is to produce the file server side and give a link to the file with instructions to right click on the link and choose "save target as..." for IE or whatever the text is for other browsers. Otherwise the xml will simply dispaly in the browser.

--

Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old April 2nd, 2005, 03:51 PM
Authorized User
 
Join Date: Jun 2003
Location: , , .
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks ... umph ... it kinda sucks but makse sense. Anyways i have tried to create the file on the server (currently localhost for testing) and IE hangs. So can anyone show me into the direction to create my report as an xml file on the server and the download process? Much appreciated

... there is always more to learn...

... there is always more to learn...
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create and Save an Xml file at client side. kiranvsamuel XML 1 June 30th, 2006 06:26 AM
Writing Client side script in code-behind asp.net sajid_pk ASP.NET 2.0 Basics 1 February 11th, 2005 04:22 AM
Writing Client Side Script from Code-Behind code sajid_pk Classic ASP Databases 1 January 18th, 2005 12:53 AM
Writing client side script in code-behind asp.net sajid_pk ADO.NET 1 January 13th, 2005 08:12 AM
writing client-side script in code-behind asp .net sajid_pk General .NET 1 January 13th, 2005 08:11 AM



All times are GMT -4. The time now is 05:29 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.