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,[email protected],TH,1000000,600000")
oFiles.WriteLine("C002,Jake Sully,[email protected],EN,2000000,800000")
oFiles.WriteLine("C003,Tony Stark,[email protected],US,3000000,600000")
oFiles.WriteLine("C004,Peter Parker,[email protected],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…
…