Solved

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

Posted on 2008-10-14
4
943 Views
Last Modified: 2012-05-05
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
Comment
Question by:rene_christensen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:si_shamil
ID: 22710671
I think the loop condition should be "f.AtEndOfStream" and not "f.AtEndOfLine"
0
 
LVL 31

Expert Comment

by:merowinger
ID: 22712095
also write
do while not f.AtEndOfStream
...
loop
0
 

Author Comment

by:rene_christensen
ID: 22718833
Changed the loop to this with no change::
do while not f.AtEndOfStream
      Response.Write(f.ReadLine)
      Response.Write("<br />")
loop
0
 

Accepted Solution

by:
rene_christensen earned 0 total points
ID: 23212903
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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
Welcome, welcome!  If you are new to the series and haven't been following along, please take a brief moment to review the first three installments: Part 1 (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/A_266-VBScri…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question