Category Archives: Database

ASP Error ‘80020009’

Again today, I came across an error caused by an invalid date value. The error reported was:

  1. error '80020009'
  2. Exception occurred.
  3. /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.

Multiple-step Operation Generated Errors

While working on some ASP today, someone reported that a page used for editing contact details was generating the following error:

  1. Microsoft Cursor Engine error '80040e21'
  2. Multiple-step operation generated errors. Check each status value.

I googled it and found some possible causes how none of them seemed to match what I was looking for. When I checked PostgreSQL for that particular item, I found that there was a date field which had the value ‘0000-12-24’ in it. I would have thought that PostgreSQL would have errored when someone tried to insert that date, however it would appear it didn’t.

The solution was simple, change the year field back to what it should have been and it was all fine. Just goes to show that you should never trust what a user enters into the system; more checking is required even on a simple thing like a date.