Forum Moderators: open

Message Too Old, No Replies

Server timeout

Can someone pleaseeee help me in this?

         

vanjamier

6:42 am on Jan 6, 2005 (gmt 0)

10+ Year Member



<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="Include/connection.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<SCRIPT LANGUAGE="JavaScript">
function checkEmail(form1) {
if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(form1.owneremail.value)){
return (true)
}
alert("Invalid E-mail Address! Please re-enter.")
return (false)
}
</script>
</head>

<body onload="document.form1.swname.value=document.form1.option1.options[document.form1.option1.selectedIndex].value">
<form method="post" enctype="multipart/form-data" action="Insert_data.asp" name=form1 onSubmit="return checkEmail(this)">
<table width="80%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td><b>Item</b></td>
<td><b>Entries</b></td>
</tr>
<tr>
<td>Software Owner :</td>
<td><input name="ownername" size="40" ></td>
</tr>
<tr>
<td>Software Email :</td>
<td><input name="owneremail" size="40" ></td>
</tr>
<tr>
<td>Software name :</td>
<td><input name="swname" size="18">
<input type="submit" name="Submit2" id="Submit3" value="Find"></td>
</tr>
<%
If Request.Form("Submit2") = "Find" Then
description = Request.Form("swname")

set rs=Server.CreateObject("ADODB.Recordset")

sql= "select id,description from standard_sw where description like '" & description & "%'" &_
" union " &_
" select id,name from legacy_sw where name like '" & description & "%'"

rs.Open sql,connStr

response.write "<select id='option1' size='1' name='option1' onchange='this.form.text1.value=this.options[this.selectedIndex].value'>"
while not rs.EOF
response.write("<option value='")
response.write(rs.fields("description"))
response.write("'")

if rs.fields("description")= description then
response.write("selected")
end if

response.write(">")
response.write(rs.fields("description"))
response.write("</option>")

rs.MoveNext
wend

response.write "</select>"
rs.Close
set rs=Nothing
End if
%>
</tr>
<tr>
<td></td>
<td><input type="submit" value="Submit" id=submit1 name=submit1 onclick="verify();"></td>
</tr>
</table>
</form>
</body>
</html>

CaseyRyan

11:53 am on Jan 6, 2005 (gmt 0)

10+ Year Member



What line is it timing out on?

How many rows are you returning in your recordset? If it's too many, you may be hitting a timeout on return. You could try to shrink the number of rows that you are returning and see if that helps. Another way to test out whether your sql statement is the culprit is to execute it on the database itself.

A way to extend the scripttimeout is to put a tag like this in the page:

<% Server.ScriptTimeout = 3600 %>

by default the scripttimeout is 90 seconds. The scriptimeout is in seconds, so 3600 = 1 hour.

-=casey=-

vanjamier

1:25 am on Jan 7, 2005 (gmt 0)

10+ Year Member



thanks, i've inserted the code

However i realised the main problem was, the connection
to the database was the wrong name...