The CInt converts anything to an integer and the Trim removes any spaces that might come in from a form field.
I normally convert to either integer, double, date, or floating-point before any math just to be on the save side - one of the problems with a loosely typed language like VB. Can't tell you what was wrong - lol - only what I do that works.
As to why it works, I'm not sure, but strings have a couple of hidden string termination characters and I seem to recall reading somewhere that stuff coming in from a query string had a couple more hidden characters added to them so maybe it's just a matter of cleaning up any hidden garbage.

EDIT: BTW - instead of request, your should use request.query for stuff coming in from a query string and request.form for stuff passed from a form - makes it a little harder to spoof/hack.
Edited by dpyers - 01 December 2004 at 10:13pm