Look at ADODB.Stream
http://support.microsoft.com/default...NoWebContent=1
You can load the object with the CSV and as long as the HTTP headers are set
correctly thenthe binary output (as Response.Write) will prompt the Save AS
dialog.
<%
'Set the content type to the specific type that you are sending.
Response.ContentType = "text/csv"
Const adTypeText = 2
'Create Stream object
Dim pobjStream
Set pobjStream = Server.CreateObject("ADODB.Stream")
'Specify stream type - we want To save text/string data.
pobjStream.Type = adTypeText
'Open the stream And write binary data To the object
pobjStream.Open
pobjStream.WriteText [YourGeneratedCSVText]
Response.BinaryWrite objStream.Read
pobjStream.Close
Set pobjStream = Nothing
%>
**** That might be Response.Write as opposed to BinaryWrite - not sure at
the moment.
Chris.
"Don Grover" <sp******@assoft.com.au> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Thanks Greg.
Had a look but what I am after, I have a complex qry that financial users
select data from a web page by submitting a form.
I am calling an asp page that gets the data format as they require and I
have it a STRING in csv format.
The above is working correctly.
What I want to do is automatically bring up a save as box to prompt them to
save it, I really dont want to save as file first unless I have too.
Anyone have any ideas.
Don
"Greg Griffiths" <gr***@surfaid.org> wrote in message
news:3F***************@surfaid.org...
try :
<a href="myCSVFile.csv">click here</a>
If it opens in the browser then the user needs to amend their settings.
see http://www.greggriffiths.org/webdev/both/excel/ for some other
approaches.
Don Grover wrote:
How can I force a download of a csv file by user clicking on hyperlink.
Don