Forum Moderators: open

Message Too Old, No Replies

Asp

Server Timeout..?!

         

vanjamier

1:18 am on Dec 15, 2004 (gmt 0)

10+ Year Member



Hello ppl,

The problem with my script is tht when i submit, the loop never ends...

The table is displayed over and over again until Timeout.

I get this message too...

Active Server Pages error 'ASP 0113'

Script timed out

/itls/slid/license_mod.asp

The maximum amount of time for a script to execute was exceeded. You can change this limit by specifying a new value for the property Server.ScriptTimeout or by changing the value in the IIS administration tools.

<%
If Request.Form("submit") = "Go" Then

Set rs = Server.CreateObject("ADODB.RecordSet")

dim count
count =0
strSearch = Request.Form(txtSearch)

'get the selected software info
sqlstr = "SELECT * from LicenseTab where SwName = '"&strSearch&"' "

Set rs = objConn.execute(sqlstr)

'Response.Write Request.Form

%>

<%
do until rs.EOF
%>

<TABLE align=center BORDER=1 CELLSPACING=2 CELLPADDING=1>
<tr><td colspan=2 align=middle><b>Software Details</b></td></tr>

<tr>
<td>Software Owner:</td>
<td><input type="text" name="txtswname" value="<%=rs("SwName")%>" size="30"></td>
</tr>

<tr>
<td>Software Email:</td>
<td><input type="text" name="txtemail" value="<%=rs("Owneremail")%>" size="30"></td>
</tr>

<tr>
<td>Software Name:</td>
<td><input type="text" name="txtname" value="<%=rs("Ownername")%>" size="30"></td>
</tr>

<tr>
<td>Software Version:</td>
<td><input type="text" name="txtswver" value="<%=rs("SwVersion")%>" size="30"></td>
</tr>

<%
count = Cint(Count)+1
rs.MoveNext
loop
%>

</TABLE>
<%rs.Close%>

<%
If count =0 then
response.write("No such software is available")
End if
%>

<%End if%>
%>

Thanks

duckhunter

2:32 pm on Dec 15, 2004 (gmt 0)

10+ Year Member



Try small result set to see if it's just the number of records causing the timeout

SELECT top 10 * from LicenseTab .....

Or set the timeout longer. The default is 30 seconds, I believe.

Server.ScriptTimeout = 300 '5 minutes

[edit]P.S. looks like you open the TABLE inside the loop and don't close it until after the loop. Start the Table tag above the while not eof[/edit]

vanjamier

1:15 am on Dec 16, 2004 (gmt 0)

10+ Year Member



I edit the table tag as you suggested.
However i still get a infinite loop

duckhunter

2:40 am on Dec 16, 2004 (gmt 0)

10+ Year Member



Are you sure you are into the loop? Has the query completed? Maybe that's what's timing out due to invalid syntax. Sometimes a malformed query will do that.

Try this before you execute the query.

Response.Write "SQL Statement: " & sqlstr
Response.End

'ie: don't execute the query, just inspect it. Try running it in Query Analyzer, what does it show?

vanjamier

5:50 am on Dec 16, 2004 (gmt 0)

10+ Year Member



SQL Statement: SELECT * from LicenseTab where SwName = ''

it doesnt show the string?
how come?

vanjamier

6:38 am on Dec 16, 2004 (gmt 0)

10+ Year Member



hey i realised it and fix the error.
the sql statement is correct now but i still get the infinite loop

syber

4:54 pm on Dec 18, 2004 (gmt 0)

10+ Year Member



The only way that this could be looping, in my opinion, is the line "rs.MoveNext" is somehow incorrect. Make sure it is not commented out and is before the loop instruction.

One other possibility, you have quotes inside of quotes:

value="<%=rs("SwVersion")%>"

Try changing those lines to:

value='<%=rs("SwVersion")%>'

Art

vanjamier

7:33 am on Dec 20, 2004 (gmt 0)

10+ Year Member



I realised, i have an infinite loop due to a filedata field in my database.

Cheers