CSV Files

Results 1 to 2 of 2

Thread: CSV Files

  1. #1
    Join Date
    Dec 1969

    Default CSV Files

    Hope I&#039;m not asking anything that&#039;s been worked out through here before, I searched and couldn&#039;t find an answer. I have some coding I came up with from searching through the forum and it&#039;s not working, maybe someone can tell me what I&#039;m doing wrong or point me to a tutorial on how to do it? I want to run a query and have it prompt to save the results on the users machine in a csv format. All it does is print out the results in the browser window. Here&#039;s my code<BR><BR>&#060;%<BR> sql = "SELECT Employee_FName, Employee_LName FROM Employee ORDER BY Employee_LName"<BR> Set RS = Server.CreateObject("ADODB.Recordset")<BR> Set RS = conn.execute(SQL)<BR><BR>Response.ContentType="app lication/csv" <BR> Response.AddHeader "Content-Disposition", "filename=fnametest.csv;" <BR><BR> Response.write "FName," <BR> Response.write "LName," <BR> Do While Not RS.EOF <BR> Response.write(RS("Employee_FName") & ",") <BR> Response.write(RS("Employee_LName") & ",") <BR> RS.MoveNext <BR> Loop <BR>%&#062;<BR><BR>Thanks for the help, much appreciated.

  2. #2
    Join Date
    Dec 1969

    Default RE: CSV Files

    Response.AddHeader "Content-Disposition", "attachment;filename=fnametest.csv" <BR><BR><BR>j<BR>http://www.sydneypubguide.net/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts