Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 961
  • Last Modified:

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

0
rene_christensen
Asked:
rene_christensen
  • 2
1 Solution
 
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
 
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now