469,936 Members | 2,365 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,936 developers. It's quick & easy.

filesys.createTextFile limit

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.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #1
3 3594
show your code

--
Mark Schupp
Head of Development
Integrity eLearning
www.ielearning.com
"eddie wang" <ew***@kmg.com> wrote in message
news:uC**************@TK2MSFTNGP10.phx.gbl...
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.

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #2
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("ApplicationPat h") &
"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>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 19 '05 #3
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.

--
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


"eddie wang" <ew***@kmg.com> wrote in message
news:eF**************@TK2MSFTNGP12.phx.gbl...
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("ApplicationPat h") &
"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>

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Anchorman | last post: by
2 posts views Thread by Laphan | last post: by
14 posts views Thread by Séverine Donnay | last post: by
8 posts views Thread by vasu1308 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.