filesys.createTextFile limit

E

eddie wang

I use filesys.createTextFile to create a csv file. If I have about 600
rows(10 columns) then I can see the csv file created. But, if I have
about 700 rows(10 columns still) then the csv file not created. I
repeated many times and the result is the same.

Is there a limitation on filesys.createTextFile?

Thanks.
 
E

eddie wang

Here is the code. The csv file is not created when the data is too
much.


<!-- #include file="includes/connectionestimator.asp" -->
<% 'Generating excel filename
dayval = datepart("d",now())
mnthval = datepart("M",now())
yrval = datepart("yyyy",now())
hrval = datepart("h",now())
minval = minute(now())
secval = datepart("s",now())

filenameval = dayval & mnthval & yrval & hrval & minval &
secval

sqlStr = Request.QueryString("sqlStr")

Set rs = conn(sqlStr)

set filesys = createObject("Scripting.FileSystemObject")
set texts = filesys.createTextFile(application("ApplicationPath") &
"repository\repository_" & filenameval & ".csv",true)

for each item in rs.fields
texts.Write item.Name & ","
next
texts.WriteLine ""

while not rs.EOF
for each item in rs.fields
if item.Value <> "" then
texts.Write replace(item.Value,","," ") & ","
else
texts.Write item.Value & ","
end if
next
texts.WriteLine ""
rs.MoveNext
wend

%>

<table width="100%">
<tr>
<td>&nbsp;</td>
</tr>
<tr>
<td align="center">Please click <a
href="repository/repository_<%=filenameval%>.csv">here</a> to view your
Excel file.</td>
</tr>
</table>
 
A

Aaron Bertrand - MVP

How big is the successful file (with 600 rows)? I've never heard of this
kind of limitation, and imagine something else is going on.

For performance reasons, you might consider using getRows() or getString()
instead of looping through, once you get the write issue sorted out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top