WHY IS THIS SCRIPT TAKING SO LONG!!!

This is a discussion on "WHY IS THIS SCRIPT TAKING SO LONG!!!" within the Classic ASP section. This forum, and the thread "WHY IS THIS SCRIPT TAKING SO LONG!!! are both part of the Program Your Website category.



 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Program Your Website > Classic ASP

Notices


Closed Thread
 
LinkBack Thread Tools
  #1  
Old Aug 28th, 2004, 18:02
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
WHY IS THIS SCRIPT TAKING SO LONG!!!

does anyone have any idea why this script should be taking so long: (theres only 2 records in the database!!!)

Code: Select all
<%

'here is the connection string
Set conn = server.createobject("adodb.connection")
'this connection uses JET 4 it is the prefered method of connecting to an access database
DSNtemp = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.Mappath("events.mdb")
'if you cant use JET then comment out the line above and uncomment the line below
'DSNtemp="DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.Mappath("/slog/login.mdb")
conn.Open DSNtemp

SQL = "SELECT * FROM events"
Set RSgetall = conn.execute(SQL)

If RSgetall.EOF Then
response.write("We currently have no events upcoming.")
Else
While Not RSgetall.EOF
thisdate = RSgetall("edate")
if (cdate(thisdate)) < Now() Then
else
eventdate = formatdatetime(thisdate,vbLongdate)
 	response.write "<table width='98%' cellspacing='0' cellpadding='0'><tr><td height='20' class='calendar' align='left'>"
	response.write "" & eventdate & "</td></tr>"
	response.write "<tr><td class='caldetails' valign='top' align='left'>"
	response.write RSgetall("venue").value & "
" & RSgetall("details").value
	response.write "</td></tr></table>
"
RSgetall.MoveNext
End If
Wend
End If

conn.Close

%>
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!

  #2  
Old Aug 28th, 2004, 18:03
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
ps the script times out (usual time of 90 secs)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #3  
Old Aug 28th, 2004, 19:21
Most Reputable Member
Join Date: Jul 2003
Posts: 1,856
Thanks: 0
Thanked 0 Times in 0 Posts
I think the problem is your .MoveNext is inside the Else of an If statement, so the recordset loops infinitely if the If is true. You want the .MoveNext to happen no matter what the IF Else does so you should put it after End If and before Wend. On a side note people usually use Do While...Loop instead of While...Wend - but I'd have to think too much to give you a reason why :wink:
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
  #4  
Old Aug 28th, 2004, 20:02
benbacardi's Avatar
Highly Reputable Member
Join Date: Feb 2004
Location: United Kingdom
Age: 20
Posts: 611
Thanks: 0
Thanked 0 Times in 0 Posts
ok thanks catalyst i never even noticed why!! i got round it anyway, not needing to compare the dates...
but i think i might change it back
that way was easier!
thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Closed Thread

Tags
script, taking, long

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Taking values from a form without sending it... Mazinger JavaScript Forum 4 Jan 8th, 2008 18:39
Taking flash games from websites DerangedGranny Flash & Multimedia Forum 13 Oct 26th, 2007 10:12
[SOLVED] not processing or just taking too long saltedm8 PHP Forum 3 Oct 17th, 2007 12:59
They are taking legal action littlebilly Starting Out 21 Sep 23rd, 2007 14:03
isn't this taking a bit too long...? tameem Web Page Design 2 May 6th, 2007 08:21


All times are GMT. The time now is 22:09.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42