Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Save Query as text

Posted on 2000-02-14
3
Medium Priority
?
164 Views
Last Modified: 2013-12-24
I have a chart displayed on a page. The chart is drawn using criteria from a form that the Customer completes. The data for the chart is kept in a SQL Server 7 db. How do I save the results of the query as a file and allow the user to download it?
0
Comment
Question by:cb1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
nathans earned 400 total points
ID: 2518582
Here is a sample on how it can be done.  Of course you need to change the query information.  If you need more help comment and I will try and help you.

<html>
<head>
      <title>Untitled</title>
</head>

<body>


<!--- This is just an example --->

<cfquery name="SampleQuery" datasource="nsnd">
select             *
from                   users
</cfquery>

<cfset loginname ="blank">
<cfoutput query="SampleQuery">
<cfset ListName = "#loginname#">

<cffile action="append" file="D:\inetpub\wwwroot\test\file.txt"  output="#listname#">

</cfoutput>
<a href="/test/file.txt">File</a>

</body>
</html>
0
 

Author Comment

by:cb1
ID: 2518716
Can you explain the <cfset loginname ="blank"> and how would I allow the user to download the results as opposed to showing them on screen.

Thanks
0
 
LVL 5

Expert Comment

by:nathans
ID: 2519083
1. You don't need the  <cfset loginname ="blank">  sorry I modified some code I have that works... and I needed it for a list.  I was creating a comma delimited list and I started with the first one as blank.

2.Since it is text it really depends on how you want the user to do it.

  A) you can name it something other then .txt like .dat or
  B) you can tell them how to right click and download the file.  

Not sure which works best for your situation but that is some of the choices I would be looking at.


Nathan Stanford
What else can I help you with?
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A web service (http://en.wikipedia.org/wiki/Web_service) is a software related technology that facilitates machine-to-machine interaction over a network. This article helps beginners in creating and consuming a web service using the ColdFusion Ma…
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question