I am successfully saving a text file from a recordset using response.write. See below:
The issue is that is also saves the whole HTML page. Am I doing something wrong?
Thanks.
Swi
Code:
if formaction = "exportcsv" Then
For Each F In rsLog.Fields
Head = Head & "," & F.Name
Next
Head = Mid(Head,2) & vbCrLf
rsLog.MoveFirst
Response.ContentType = "text/plain"
Response.AddHeader "Content-Disposition", "attachment;filename=test.txt"
Response.Write Head & rsLog.GetString(2, , ",", vbCrLf, "")
The issue is that is also saves the whole HTML page. Am I doing something wrong?
Thanks.
Swi