First of all, you have to find the *REAL* reason for the error.
And that means DEBUG DEBUG DEBUG.
Try using ON ERROR RESUME NEXT ... ON ERROR GOTO 0 around the possible problem lines and then report on the error found, if any.
If it's simply a matter of sending back too much data to the user, though, an easy answer is to call
RESPONSE.FLUSH
occasionally.
Something like this perhaps:
Code:
count = 0
DO Until RS.EOF
... output a bunch of stuff from that RS ...
RS.MoveNext
count = count + 1
If count MOD 100 = 0 Then Response.Flush
Loop
You can adjust the number there (100) upwards or downwards. Upwards to get more efficiency but if you go too high then you'll get the buffer overflow error that is triggering the Error 500. Lower is you really are pumping out a ton of data from each record. But 100 is probably a nice handy starting number that should work for most pages.