How to use ASP & Export/Convert to CSV file This is learn/tutorial asp developers how to using aspĀ Export/Convert to CSV file
ShotDev Focus:
- ASP & Export/Convert to CSV file
Example
asp_export_csv.asp
<%Option Explicit%> <html> <head> <title>ShotDev.Com Tutorial</title> </head> <body> <% Dim objFSO,oFiles Dim sFileName sFileName = "shotdev/customer.csv" '*** Create Object ***' Set objFSO = CreateObject("Scripting.FileSystemObject") '*** Create Text Files ***' Set oFiles = objFSO.CreateTextFile(Server.MapPath(sFileName), 2) oFiles.WriteLine("C001,Win Weerachai,win.weerachai@shotdev.com,TH,1000000,600000") oFiles.WriteLine("C002,Jake Sully,jake.sully@shotdev.com,EN,2000000,800000") oFiles.WriteLine("C003,Tony Stark,tony.stark@shotdev.com,US,3000000,600000") oFiles.WriteLine("C004,Peter Parker,peter.parker@shotdev.com,US,4000000,100000") oFiles.Close() Set oFiles = Nothing Set objFSO = Nothing Response.write "Generate CSV completed.<br><a href="&sFileName&">Download</a>" %> </body> </html>
Create a asp file and save to path root-path/myasp/
Run
http://localhost/myasp/asp_export_csv.asp
Screenshot
1immediately…
…