Again today, I came across an error caused by an invalid date value. The error reported was:
/somefile.asp, line <number>
Went and googled again, this time it appeared as though the error was commonly caused by over-stepping the bounds of the resultset. For instance, pulling back 10 records by trying to read the 11th which doesn’t exist. Well that wasn’t the case for mine (once again), it was an invalid date format.
All I was doing, was displaying the date value. I wasn’t using it to do any calculations in either ASP or through SQL, so even it if was invalid, you would assume it would just ‘display it’ and be done with it.
For whatever reason, just trying to display a date of format ‘0000-01-04’ caused it to fall over. The solution of course, just correct the date value. Once again, lack of client and server side checking of user input bites you in the arse.