October 30, 2020, 07:15:06 pm
News: If someone gives you crap then give them a Bad Star
Pages: [1]   Go Down
Author Topic: Session.Abandon on error  (Read 3415 times)
simmo
Administrator
*

Stars: +3/-0
Offline Offline

Gender: Male
Posts: 8558



« on: December 05, 2002, 08:31:53 pm »

I have an ASP/VBScript app that reads info from an XML file, processes it, and kills the session. I am running this via a VB6 app that refreshes the ASP page every minute or so. Everything is fine unless it encounters a problem, then refreshes w/o killing the session vars. How would I go about makeing it do this on error?
Thanks
Michael
Logged

                 ..... .....

Kings
Hero Member
*

Stars: +0/-0
Offline Offline

Posts: 696


WWW
« Reply #1 on: December 05, 2002, 09:05:58 pm »

You\'d probably do something like this (not sure though, haven\'t tested),
Code:
On Error Resume Next



\'Do you\'re processing here



If Err.number > 0 Then

\'Error Occured!

Session.Abandon

End If



\'Do some more processing perhaps
Logged

K i n g s

[span style=\'font-size:8pt;line-height:100%\']Several handy ASP Resources:
| | | |

Several handy ASP.NET resources:
| | | |

Several paid ASP/ASP.NET webhosts:
| | | | |

Several handy ASP bulletin boards:
| | | |

ASP applications I made:
| |

Do you know another handy ASP resource? [a href=\'mailto:Kings@AspIt.net\']e-mail me[/a]![/span]

simmo
Administrator
*

Stars: +3/-0
Offline Offline

Gender: Male
Posts: 8558



« Reply #2 on: December 05, 2002, 09:12:40 pm »

But for that I would want to put it in all the places a potential error may occur correct? (not that it is a bad thing). Is there a GoTo in asp/vbscript?
Logged

                 ..... .....

Kings
Hero Member
*

Stars: +0/-0
Offline Offline

Posts: 696


WWW
« Reply #3 on: December 05, 2002, 09:17:48 pm »

No, there isn\'t a GoTo function. You just have to place
Code:
If Err.number > 0 Then

\'Error Occured!

Session.Abandon

End If

in every place a potential error may occur, like you said yourself.
Logged

K i n g s

[span style=\'font-size:8pt;line-height:100%\']Several handy ASP Resources:
| | | |

Several handy ASP.NET resources:
| | | |

Several paid ASP/ASP.NET webhosts:
| | | | |

Several handy ASP bulletin boards:
| | | |

ASP applications I made:
| |

Do you know another handy ASP resource? [a href=\'mailto:Kings@AspIt.net\']e-mail me[/a]![/span]

simmo
Administrator
*

Stars: +3/-0
Offline Offline

Gender: Male
Posts: 8558



« Reply #4 on: December 05, 2002, 09:20:44 pm »

Thats probably for the best anyway
Thanks (tick)
Michael

ps that was your 666th post! post-445-1117170441[1]
Logged

                 ..... .....

Kings
Hero Member
*

Stars: +0/-0
Offline Offline

Posts: 696


WWW
« Reply #5 on: December 07, 2002, 01:47:41 pm »

Quote
Originally posted by msimmons
Thanks (tick)  

ps that was your 666th post! post-445-1117170441[1]
Thanks, and is it coincidence that I had 666 posts? I think not:evil
Logged

K i n g s

[span style=\'font-size:8pt;line-height:100%\']Several handy ASP Resources:
| | | |

Several handy ASP.NET resources:
| | | |

Several paid ASP/ASP.NET webhosts:
| | | | |

Several handy ASP bulletin boards:
| | | |

ASP applications I made:
| |

Do you know another handy ASP resource? [a href=\'mailto:Kings@AspIt.net\']e-mail me[/a]![/span]

Pages: [1]   Go Up
Print
 
Jump to: