Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

why is this timing out?

Status
Not open for further replies.

apexinternet

Programmer
May 28, 2001
30
US
can someone look at this code and see why its timing out?

<%if request(&quot;date&quot;)<>&quot;&quot; then%><p>Processing Company Queries..</p><%end if%>
<%
'on error resume next
if request(&quot;dmin&quot;)<>&quot;&quot; then

dim query ' make room for sqlupdate parameters

query=&quot;select * from querys&quot;

set conn = Server.CreateObject(&quot;ADODB.Connection&quot;)

set conn2 = Server.CreateObject(&quot;ADODB.Connection&quot;)

conn.open &quot;dsn=driversearch2&quot;

conn2.open &quot;dsn=newdriverapps&quot;

set rs=conn.execute(query)
do while not rs.eof
if request(&quot;send-&quot;&rs(&quot;company&quot;))=&quot;Yes&quot; or request(&quot;sendall&quot;)=&quot;Yes&quot; then
queryyes=rs(&quot;query&quot;)
email1=rs(&quot;email1&quot;)
email2=rs(&quot;email2&quot;)
email3=rs(&quot;email3&quot;)
email4=rs(&quot;email4&quot;)
email5=rs(&quot;email5&quot;)
query3=rs(&quot;query&quot;)
query2=&quot;select * from results where (&quot; &queryyes
query2=query2 & &quot;) and status='approved' and (dated between #&quot;&request(&quot;dmin&quot;)&&quot;# and #&quot;&request(&quot;dmax&quot;)&&quot;#) and state<>'HI' and state<>'AK' and state<>'CN' and state<>'MX' and state<>'AU' and state<>'VI'&quot;
response.write &quot;<table><tr><td><font face=arial size=2>Company: &quot; & rs(&quot;company&quot;)&&quot;<br><br></font>&quot;
response.write &quot;<font face=arial size=2>Query:&quot;&query2&&quot;<br><br></font>&quot;
set rs2=conn2.execute(query2)
' create an aspemail object
count=0
emailcount=0
do while not rs2.eof
if count=150 then exit do
set objmail=createobject(&quot;Persits.MailSender&quot;)
objMail.IsHTML=True
' build body of email
objMail.ContentTransferEncoding = &quot;Quoted-Printable&quot;
' build body of email
themessage=&quot;&quot;
altmessage=altmessage&&quot;This application was provided solely for BestDriverJobs.com recruiting network clients and employees only.&quot;&chr(13)&chr(10)
themessage=themessage&&quot;This application was provided solely for BestDriverJobs.com recruiting network clients and employees only.&quot;&&quot;<br>&quot;
altmessage=altmessage&&quot;Violation of this notice will result in appropriate legal action.&quot;&chr(13)&chr(10)
themessage=themessage&&quot;Violation of this notice will result in appropriate legal action.<br>&quot;
altmessage=altmessage&chr(13)&chr(10)
themessage=themessage&&quot;<br>&quot;
for a=1 to 120
altmessage=altmessage&rs2.Fields(a).Name&&quot;: &quot;&rs2.Fields(a).Value & vbCRLF
themessage=themessage&&quot;<b>&quot;&rs2.Fields(a).Name&&quot;:</b> &quot;&rs2.Fields(a).Value & &quot;<br>&quot;
next
themessage=themessage& &quot;<b>Background Check</b>: Yes&quot;
altmessage=altmessage & &quot;Background Check: Yes&quot;&chr(13)&chr(10)
objMail.Host=&quot;objMail.From=&quot;driverapps@bestdriverjobs-apps.com&quot;
'objMail.addaddress &quot;chris@apexid.com&quot;
'objMail.addaddress &quot;hereinz@hotmail.com&quot;
if email1<>&quot; &quot; or emaill<>&quot;&quot; then objMail.addaddress email1
if email2<>&quot; &quot; or email2<>&quot;&quot; then objMail.addaddress email2
if email3<>&quot; &quot; or email3<>&quot;&quot; then objMail.addaddress email3
if email4<>&quot; &quot; or email4<>&quot;&quot; then objMail.addaddress email4
if email5<>&quot; &quot; or email5<>&quot;&quot; then objMail.addaddress email5
'objMail.addaddress &quot;chris@apexid.com&quot;'
objMail.addbcc &quot;chris@apexid.com&quot;
objMail.Subject=&quot;Driver Application - &quot;&FormatDateTime(Now)
objMail.Body=themessage
objMail.AltBody=altmessage
objMail.SendToQueue() ' send email
'objMail.Send() ' send email
set objmail=nothing
if err.number<>0 then errortext=errorstext&err.description
emailcount=emailcount+1
rs2.movenext
count=count+1
response.write &quot;</td></tr></table>&quot;
loop
errortext=errortext&&quot;<br><br>&quot;&&quot;Emails Sent to:&quot;&&quot;<br>&quot;
if email1<>&quot;&quot; then errortext=errortext&&quot;&quot;&email1
if email2<>&quot;&quot; then errortext=errortext&&quot;-&quot;&email2
if email3<>&quot;&quot; then errortext=errortext&&quot;-&quot;&email3
if email4<>&quot;&quot; then errortext=errortext&&quot;-&quot;&email4
if email5<>&quot;&quot; then errortext=errortext&&quot;-&quot;&email5
errortext=errortext&&quot;<br>&quot;
response.write &quot;<font face=arial size=2>Errors Received:</font><br>&quot;
response.write &quot;<font face=arial size=2>&quot;&errortext&&quot;</font><br>&quot;
response.write &quot;<font face=arial size=2>Total Emails:&quot;&emailcount&&quot;<br><hr><br></font>&quot;
errortext=&quot;&quot;
else
if rs.eof<>true then rs.movenext
end if
if rs.eof<>true then rs.movenext
loop
end if
%>
 
PERSITS component can tend to be a bit slow sometimes.

I would suggest upping your timeout limit

server.scriptTimeout = 100

or something like that.
penny.gif
penny.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top