Active Server Pages error 'ASP 0113' Script timed out

Discussion in 'ASP General' started by Justin Doh, Sep 29, 2008.

  1. Justin Doh

    Justin Doh Guest

    I am constantly getting the 'Script timed out' error, and would like to see
    if there is any way I could modify the ASP page.

    I think I did all I could to improved the performance at the database table
    level, but when it comes to the ASP, the error occurs most of time.
    This error happens when this ASP page has been moved to a new server.

    I modified the "server.ScriptTimeout = " at the ASP and also at IIS.
    The report does not retrieve the whole records, but it stops in the middle,
    and giving this error message.

    I am also curious whether .AbsolutePosition might be a factor? But on the
    previous server, I had no problem.

    Here is the part of ASP page where it retrieves a data.

    strSQL = "spHWABPOOrderSelect_1 " & nAcctNum
    Dim rsHBSBPOOrder : Set rsHWABPOOrder = New clsRecordSet
    With rsHBSBPOOrder
    .ConnectionString = ConnHBS
    .Load(strSQL)
    Dim nTmp
    Do While Not .EOF
    if .AbsolutePosition = 0 Then
    nBPO1Val = Trim(.Fields("curBPOAsIs")&"")
    If Len(nBPO1Val) <> 0 Then
    nBPO1Val = FormatCurrency(nBPO1Val, 0)
    End If
    nTmp = nBPO1Val
    dtBPO1 = Trim(.Fields("dtReceived")&"")
    ElseIf .AbsolutePosition = 1 Then
    nBPO2Val = Trim(.Fields("curBPOAsIs")&"")
    If Len(nBPO2Val) = 0 Then
    nBPO2Val = nTmp
    Else
    nBPO2Val = FormatCurrency(nBPO2Val, 0)
    End If
    dtBPO2 = Trim(.Fields("dtReceived")&"")
    End If
    .MoveNext
    Loop
    End With
    Set rsHWABPOOrder = Nothing
    Justin Doh, Sep 29, 2008
    #1
    1. Advertising

  2. This procedure can never return more than 2 records?
    If it can, why are you bothering to continue looping through it when
    absoluteposition is > 1?
    Also, why don't you rewrite the procedure to only return two records?

    You don't show where the value contained in nAcctNum comes from, but you
    are aware that using this technique to execute a procedure leaves you
    vulnerable to sql injection, don't you?

    Justin Doh wrote:
    > I am constantly getting the 'Script timed out' error, and would like
    > to see if there is any way I could modify the ASP page.
    >
    > I think I did all I could to improved the performance at the database
    > table level, but when it comes to the ASP, the error occurs most of
    > time.
    > This error happens when this ASP page has been moved to a new server.
    >
    > I modified the "server.ScriptTimeout = " at the ASP and also at IIS.
    > The report does not retrieve the whole records, but it stops in the
    > middle, and giving this error message.
    >
    > I am also curious whether .AbsolutePosition might be a factor? But on
    > the previous server, I had no problem.
    >
    > Here is the part of ASP page where it retrieves a data.
    >
    > strSQL = "spHWABPOOrderSelect_1 " & nAcctNum
    > Dim rsHBSBPOOrder : Set rsHWABPOOrder = New clsRecordSet
    > With rsHBSBPOOrder
    > .ConnectionString = ConnHBS
    > .Load(strSQL)
    > Dim nTmp
    > Do While Not .EOF
    > if .AbsolutePosition = 0 Then
    > nBPO1Val = Trim(.Fields("curBPOAsIs")&"")
    > If Len(nBPO1Val) <> 0 Then
    > nBPO1Val = FormatCurrency(nBPO1Val, 0)
    > End If
    > nTmp = nBPO1Val
    > dtBPO1 = Trim(.Fields("dtReceived")&"")
    > ElseIf .AbsolutePosition = 1 Then
    > nBPO2Val = Trim(.Fields("curBPOAsIs")&"")
    > If Len(nBPO2Val) = 0 Then
    > nBPO2Val = nTmp
    > Else
    > nBPO2Val = FormatCurrency(nBPO2Val, 0)
    > End If
    > dtBPO2 = Trim(.Fields("dtReceived")&"")
    > End If
    > .MoveNext
    > Loop
    > End With
    > Set rsHWABPOOrder = Nothing


    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Sep 29, 2008
    #2
    1. Advertising

  3. Justin Doh

    Justin Doh Guest

    Hi Bob,

    I appreciate for your feedback.

    I am not sure how I could modify the Do While Loop..
    Do you have any suggestions?
    I know I am only getting two values, but doesn't it have to go through the
    end of file?

    Regards to your second feedback, I am not sure what you meant.
    >You don't show where the value contained in nAcctNum comes from, but you
    > are aware that using this technique to execute a procedure leaves you
    > vulnerable to sql injection, don't you?



    "Bob Barrows [MVP]" wrote:

    > This procedure can never return more than 2 records?
    > If it can, why are you bothering to continue looping through it when
    > absoluteposition is > 1?
    > Also, why don't you rewrite the procedure to only return two records?
    >
    > You don't show where the value contained in nAcctNum comes from, but you
    > are aware that using this technique to execute a procedure leaves you
    > vulnerable to sql injection, don't you?
    >
    > Justin Doh wrote:
    > > I am constantly getting the 'Script timed out' error, and would like
    > > to see if there is any way I could modify the ASP page.
    > >
    > > I think I did all I could to improved the performance at the database
    > > table level, but when it comes to the ASP, the error occurs most of
    > > time.
    > > This error happens when this ASP page has been moved to a new server.
    > >
    > > I modified the "server.ScriptTimeout = " at the ASP and also at IIS.
    > > The report does not retrieve the whole records, but it stops in the
    > > middle, and giving this error message.
    > >
    > > I am also curious whether .AbsolutePosition might be a factor? But on
    > > the previous server, I had no problem.
    > >
    > > Here is the part of ASP page where it retrieves a data.
    > >
    > > strSQL = "spHWABPOOrderSelect_1 " & nAcctNum
    > > Dim rsHBSBPOOrder : Set rsHWABPOOrder = New clsRecordSet
    > > With rsHBSBPOOrder
    > > .ConnectionString = ConnHBS
    > > .Load(strSQL)
    > > Dim nTmp
    > > Do While Not .EOF
    > > if .AbsolutePosition = 0 Then
    > > nBPO1Val = Trim(.Fields("curBPOAsIs")&"")
    > > If Len(nBPO1Val) <> 0 Then
    > > nBPO1Val = FormatCurrency(nBPO1Val, 0)
    > > End If
    > > nTmp = nBPO1Val
    > > dtBPO1 = Trim(.Fields("dtReceived")&"")
    > > ElseIf .AbsolutePosition = 1 Then
    > > nBPO2Val = Trim(.Fields("curBPOAsIs")&"")
    > > If Len(nBPO2Val) = 0 Then
    > > nBPO2Val = nTmp
    > > Else
    > > nBPO2Val = FormatCurrency(nBPO2Val, 0)
    > > End If
    > > dtBPO2 = Trim(.Fields("dtReceived")&"")
    > > End If
    > > .MoveNext
    > > Loop
    > > End With
    > > Set rsHWABPOOrder = Nothing

    >
    > --
    > Microsoft MVP -- ASP/ASP.NET
    > Please reply to the newsgroup. The email account listed in my From
    > header is my spam trap, so I don't check it very often. You will get a
    > quicker response by posting to the newsgroup.
    >
    >
    >
    Justin Doh, Sep 29, 2008
    #3
  4. Justin Doh wrote:
    > Hi Bob,
    >
    > I appreciate for your feedback.
    >
    > I am not sure how I could modify the Do While Loop..
    > Do you have any suggestions?
    > I know I am only getting two values, but doesn't it have to go
    > through the end of file?


    No. If you are only getting two records, you don't even need a loop.

    With rsHBSBPOOrder
    .ConnectionString = ConnHBS
    .Load(strSQL)
    Dim nTmp
    If not .EOF Then
    'recordset is automatically pointing at first record
    If Len(nBPO1Val) <> 0 Then
    nBPO1Val = FormatCurrency(nBPO1Val, 0)
    End If
    nTmp = nBPO1Val
    dtBPO1 = Trim(.Fields("dtReceived")&"")
    .MoveNext
    If not .EOF Then
    'recordset is now pointing at second record
    nBPO2Val = Trim(.Fields("curBPOAsIs")&"")
    If Len(nBPO2Val) = 0 Then
    nBPO2Val = nTmp
    Else
    nBPO2Val = FormatCurrency(nBPO2Val, 0)
    End If
    dtBPO2 = Trim(.Fields("dtReceived")&"")
    End If
    End If
    ..Close '<---
    End With
    Set rsHWABPOOrder = Nothing

    <--- I added the .Close statement, but I recognize I may not have had
    to. Does your clsRecordSet class have a Terminate event in which the
    recordset and connection are closed? I do hope you are explicitly
    closing the database connection ...

    >
    > Regards to your second feedback, I am not sure what you meant.
    >> You don't show where the value contained in nAcctNum comes from, but
    >> you are aware that using this technique to execute a procedure
    >> leaves you vulnerable to sql injection, don't you?

    >
    >

    See what happens if nAcctNum contains something like

    1234;create table test (testcol int);

    Read about sql injection in these links:
    http://www.sqlsecurity.com/DesktopDefault.aspx?tabid=23
    http://www.nextgenss.com/papers/advanced_sql_injection.pdf
    http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf
    http://www.spidynamics.com/papers/SQLInjectionWhitePaper.pdf

    --
    Microsoft MVP -- ASP/ASP.NET
    Please reply to the newsgroup. The email account listed in my From
    header is my spam trap, so I don't check it very often. You will get a
    quicker response by posting to the newsgroup.
    Bob Barrows [MVP], Sep 29, 2008
    #4
    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. Steve
    Replies:
    0
    Views:
    5,316
    Steve
    Jul 1, 2003
  2. carlos seramos
    Replies:
    2
    Views:
    463
    carlos seramos
    Aug 1, 2003
  3. Usama Zulfiqar

    ASP 0113 Error "Time Out"

    Usama Zulfiqar, Jun 17, 2006, in forum: ASP General
    Replies:
    2
    Views:
    121
    Usama Zulfiqar
    Jun 18, 2006
  4. george
    Replies:
    0
    Views:
    128
    george
    Sep 12, 2006
  5. Justin Doh

    Active Server Pages error 'ASP 0113'

    Justin Doh, Sep 11, 2008, in forum: ASP General
    Replies:
    21
    Views:
    656
    MikeR
    Sep 13, 2008
Loading...

Share This Page