Problems with ASP Script

C

c

I have the following very simple script which works on my desktop (XP-PRO &
IIS5.1) but does not work on my laptop with the same config. It also works
on other configurations without a problem. I have tried re installing IIS
which has not made any difference. The script gets to the line annotated
"'This is where it breaks" and at this line the script simply hangs with no
error message at all.



I would guess this is some kind of config problem but I have tried comparing
a system that works against this one but haven't been able to find any
differences.



Any help/guidance would be appreciated.



..cw.



Script is as follows:-



<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>

<html>

<head>

<title>Read Text File</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body bgcolor="#CACAFF">

<%

Dim fs,readfile



'Now read back the the data

response.write "reading data from file"



Set fs = CreateObject("Scripting.FileSystemObject")

filename=server.mappath("Information.txt")

response.write "-----" & filename &"-----"

'response.flush

Set readfile=fs.OpenTextFile(filename,ForAppending,True)'this is
where it breaks

response.write "FS Open created OK"

Do until readfile.AtEndOfStream

response.write "<br>"

%>

<%

Text=readfile.readline

If Text="" then

response.write "<p>"

Else

response.write Text

End If

Loop

readfile.close

set readfile=nothing



%>



</body>

</html>
 
C

c

My error the code example was wrong (finger trouble) the code is ....

<html>

<head>

<title>Read Text File</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>

<body bgcolor="#CACAFF">

<%

Dim fs,readfile



'Now read back the the data

response.write "reading data from file"



Set fs = CreateObject("Scripting.FileSystemObject")

filename=server.mappath("Information.txt")

response.write "-----" & filename &"-----"

'response.flush

Set readfile=fs.OpenTextFile(filename,1,True)'this is where it
breaks

response.write "FS Open created OK"

Do until readfile.AtEndOfStream

response.write "<br>"

%>

<%

Text=readfile.readline

If Text="" then

response.write "<p>"

Else

response.write Text

End If

Loop

readfile.close

set readfile=nothing



%>



</body>

</html>
 
C

c

Thanks Ray, your a Star... I would never have guessed this. I have different
AVP on each system.
Cheers,

...c..
 

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,755
Messages
2,569,536
Members
45,013
Latest member
KatriceSwa

Latest Threads

Top