web 2.0

How to use ASP & Export/Convert to CSV file

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

ASP & Export/Convert to CSV file

ASP & Export/Convert to CSV file

.
.
.
Download this script.
Download

1 Star2 Stars3 Stars4 Stars5 Stars6 Stars7 Stars8 Stars9 Stars10 Stars (1 votes, average: 1.00 out of 10)
Loading ... Loading ...

One Response to “How to use ASP & Export/Convert to CSV file”

  1. 1immediately…

Leave a Reply

You must be logged in to post a comment.