| Download A Recordset as a CSV (DBF, MDB) 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,"") %>