p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

proasp_howto thread: download a recordset to a .csv file

Message #1 by "mark eckeard" <meckeard2000@y...> on Fri, 3 Aug 2001 20:56:19
just use getString to convert to a .CSV file and then change the content 
type and response.write the stream out.

something like....

response.buffer = true
set oConn = server.createobject("adodb.connection")
set oRs = server.createobject("adodb.recordset")
oConn.open sConnString
set oRs oConn.execute("Select fld1, fld2 from mytable")
if not(ors.eof) then
         sCSV = oRs.getString('get the correct params here)
         response.contentype = "applcation/csv"  ' ? correct content type ?
         response.write sCSV
         response.write "No Data"
end if

if the data doesnt change that much you could consider caching to disk

also consider using XML

At 08:56 PM 8/3/2001 +0000, you wrote:
>Does anyone know how to download a recordset into a .csv file?

Robert Chartier
Author and Developer

  Return to Index