Scripting.FileSystemObject - ReadLine() refuses to read the entire textfile

The scripts final purpose is to execute a series of SQL statements for import of data into a database, but since it is not the problem i have only attached a small code sample that i need help with.

if you go to
http://windkin.dk/progress.asp
you can try and upload the attached csv file. The file will be correctly uploaded. I checked by opening the uploaded version and all 10000 lines are there.
After upload the user is directed to http://windkin.dk/importer.asp
This is where the problem starts. When the script have read 3150 lines it just stop. It is not because of a timeout.
In this "version" i output the data to the browser window
Can anyone guess what is going wrong.
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<%
Server.ScriptTimeout = 1200
Set fs=Server.CreateObject("Scripting.FileSystemObject")
Set f=fs.opentextfile("c:\www\windkin.dk\" & request.QueryString("filnavn"),1)
 
do while f.AtEndOfLine = false
	Response.Write(f.ReadLine)
	Response.Write("<br />")
loop
 
f.Close
Set f=Nothing
Set fs=Nothing
%>
</body>
</html>

Open in new window

rene_christensenAsked:
Who is Participating?
 
rene_christensenAuthor Commented:
unfortunatly I have not been able to find a solution for this question.
Can I close unanswered question, or what should I do?
0
 
si_shamilCommented:
I think the loop condition should be "f.AtEndOfStream" and not "f.AtEndOfLine"
0
 
merowingerCommented:
also write
do while not f.AtEndOfStream
...
loop
0
 
rene_christensenAuthor Commented:
Changed the loop to this with no change::
do while not f.AtEndOfStream
      Response.Write(f.ReadLine)
      Response.Write("<br />")
loop
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.