Download A Recordset as a CSV file

You can use GetString method of recordset object to convert recordset (SQL query) to csv file :

<%
Dim RS, SQL, Conn
SQL = "Some query ...."
Set RS = Conn.Execute (SQL)

Dim F, Head
For Each F In RS.Fields
  Head = Head & ", " & F.Name
Next
Head = Mid(Head,3) & vbCrLf
Response.ContentType = "text/plain"
Response.Write Head
Response.Write RS.GetString(,,", ",vbCrLf,"")
%>


asp recordset csv MDB DBF howto reference examples samples source code demos tips


Back To Top
© 1998 - 2024 psacake.com
Version 7.21 | Advertise on this site