Problems with ASP Script

Discussion in 'ASP General' started by c, Oct 28, 2003.

  1. c

    c Guest

    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, Oct 28, 2003
    #1
    1. Advertising

  2. c

    Ray at Guest

    http://www.aspfaq.com/2180

    "c" <> wrote
    > hangs with no error message
    > Set readfile=fs.OpenTextFile(filename,ForAppending,True)
     
    Ray at, Oct 28, 2003
    #2
    1. Advertising

  3. c

    c Guest

    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" <> wrote in message
    news:sZtnb.1702$9.net...
    > 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, Oct 28, 2003
    #3
  4. c

    Ray at Guest

    http://www.aspfaq.com/2180

    "c" <> wrote
    > hangs with no error message
    > Set readfile=fs.OpenTextFile(filename,ForAppending,True)
     
    Ray at, Oct 28, 2003
    #4
  5. c

    c Guest

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

    ...c..

    "Ray at <%=sLocation%>" <myfirstname at lane34 dot com> wrote in message
    news:...
    > http://www.aspfaq.com/2180
    >
    > "c" <> wrote
    > > hangs with no error message
    > > Set readfile=fs.OpenTextFile(filename,ForAppending,True)

    >
    >
     
    c, Oct 28, 2003
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. ZMan
    Replies:
    0
    Views:
    3,386
  2. =?Utf-8?B?TG93bGFuZGVy?=
    Replies:
    0
    Views:
    393
    =?Utf-8?B?TG93bGFuZGVy?=
    Mar 27, 2007
  3. Rajat
    Replies:
    3
    Views:
    747
    Jorgen Grahn
    Jan 8, 2010
  4. VYAS ASHISH M-NTB837
    Replies:
    2
    Views:
    602
    Jan Kaliszewski
    Jan 7, 2010
  5. Simon Wigzell

    Calling an asp script from an asp script

    Simon Wigzell, May 8, 2004, in forum: ASP General
    Replies:
    4
    Views:
    184
    Lance Wynn
    May 10, 2004
Loading...

Share This Page