Response.Buffer = true
Response.AddHeader "Content-Disposition","attachment; filename=member.csv"
Response.CharSet = "UTF-8"
Response.ContentType = "application/octet-stream"
dim conn,rs,i
set conn = Server.CreateObject("Adodb.Connection")
conn.open connectionstring

set rs = conn.Execute("select * from [User] order by [UserId]")
Response.Write rs.fields(0).name
for i=1 to rs.fields.count-1
Response.Write "," & rs.fields(i).name
next
Response.Flush()
do while not rs.eof
Response.Write vbCrLf & rs(0)
for i=1 to rs.fields.count-1
Response.Write "," & rs(i)
next
Response.Flush()
rs.Movenext
loop
rs.Close
conn.Close

set rs = nothing
set conn = nothing
Response.End()