Quick and Easy method:
Response.Clear
Response.ContentType = "application/vnd.ms-excel"
Response.AddHeader "Content-Disposition", "inline;filename=requests.csv"
'Response.AddHeader "Content-Disposition", "attachment;filename=requests.csv"
Dim header : header = ""
prefix = false
Dim field
for each field in rs.Fields
if(prefix) then
header = header & ","
end if
header = header & field.Name
prefix = true
next
Response.Write header & vbCRLF & rs.GetString(,,",",,"")
Response.End
No comments:
Post a Comment