Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Downloading from an asp page to a csv file.

Status
Not open for further replies.

redcare

Technical User
May 20, 2001
32
0
0
GB
Hi

I have a database that carries out searches through 4 different drop down boxes and displays the results on a web page.
I would like if possible to have the option to view the results on the web page as present or to down load the results to a csv file.
Is this possible.

Any help will be greatly appreciated.

Regards
Redcare
 
You can save the file using this piece of code.
If you want the file as csv then do the printout of your querry as you wish, if not just use as usual.
Code:
if Request(&quot;CSV&quot;)<>&quot;&quot; then
 Response.AddHeader &quot;Content-type&quot;,&quot;text/plain&quot;
 Response.AddHeader &quot;Content-Disposition&quot;,&quot;attachment; filename=myfile.csv&quot;
 Response.Write strCsvFormatData
 Response.End
else
'printout normal html code
end if


________
George, M
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top