Forum Moderators: open
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
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]
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?
One other possibility, you have quotes inside of quotes:
value="<%=rs("SwVersion")%>"
Try changing those lines to:
value='<%=rs("SwVersion")%>'
Art