VB Code:
'open the record set and assign the command results to the recordset before this point
Response.ContentType = "text/csv"
Dim DoneOnce as Boolean = False
while objRS.Read()
if not DoneOnce then
For x = 0 to objRS.fieldCount - 1
response.write(objRS.item(x).key & Microsoft.VisualBasic.vbTab)
Next
Response.Write(Microsoft.VisualBasic.vbCrLf)
DoneOnce = True
End If
For x = 0 to objRS.fieldCount - 1
response.write(objRS.item(x) & Microsoft.VisualBasic.vbTab)
Next
Response.write(Microsoft.VisualBasic.vbCrLf)
End While