Link to home
Start Free TrialLog in
Avatar of Graeme McGilvray
Graeme McGilvrayFlag for Australia

asked on

Server Timeout with Loop

Hi there, for some reason I am having a server timeout with my loop, cant figure it out

    DayCount=0
    Do Until DayCount>=4
      DayCount=DayCount+1
  		Response.Write(DayCount&"<br>")
    Loop

Open in new window


What ends up happening is that outputs 43537 times... where as I want to output 1,2,3,4,5 - ideas?
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

DayCount=0
    Do Until DayCount>=4
      DayCount=DayCount+1
              Response.Write(DayCount&"<br>")
    Loop

by using this codes, it should generate this as the output:
1
2
3
4

Open in new window


What ends up happening is that outputs 43537 times... where as I want to output 1,2,3,4,5 - ideas?
Are you reusing/reassigning the variable: DayCount somewhere in your codes?
Avatar of Graeme McGilvray

ASKER

Hi Ryan, yeah it should, however it is producing alot more :(

43525
43526
43527
43528
43529
43530
43531
43532
43533
43534
43535
43536
43537
Active Server Pages error 'ASP 0113'

Script timed out

/admingpt.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.

Open in new window

can you post full codes here?
    DayCount=0
    Do Until DayCount>=Request.Form("itindays")
      DayCount=DayCount+1
  		oConn.Execute("INSERT INTO itin_days(itin_ID,brand_ID,itin_day,itin_arrcity,day_added,day_cons) VALUES("&ItinID&",'GPT',"&DayCount&",'"&ItinLocation("location_IATA")&"','"&NOW()&"',2000)")
  		Response.Write(DayCount&"<br>")
    Loop

Open in new window


I have Response Wrote - Request.Form("itindays") and that = 4
ASKER CERTIFIED SOLUTION
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Worked!

How strange!

Thanks mate!