There are several variations of the 80020005 error. Here are a few of them:
Server object error 'ASP 0193 : 80020005' (or 'ASP 0193 : 80020009') OnStartPage Failed /<file>.asp, line <line> An error occurred in the OnStartPage method of an external object. |
This is typically an error coming from a custom COM object / component. One way around it is to re-write the object using ObjectContext, instead of onStartPage / onEndPage (which are deprecated as of the release of Windows 2000).
Provider error '80020005' Type mismatch. |
This can happen if you try to set a date column to a value that is not in proper date format, e.g. "UPDATE tableName SET dateColumn='31/31/2002'"... it can also happen when using a command object and named constants (e.g. adDate and adLongVarChar); I will always recommend using a straight EXEC statement against a connection object, rather than go through the hassle and rigorous code required by an ADODB.Command object.
Response object error 'ASP 0106 : 80020005' Type Mismatch /<file>.asp, line <line> An unhandled data type was encountered. |
This can happen if you try to response.write an array, or data coming out of a blob / ole / image column, or response.binarywrite non-binary data. To get around the blob scenario, you can upgrade to the latest MDAC (
MDAC Download Page), which allows you to avoid the GetChunk / AppendChunk methods. See
KB #258038 for (admittedly VB-based) samples of avoiding GetChunk and AppendChunk, and
KB #276488 for sample code using ADODB.Stream to send binary data to the browser...
Another scenario is using a COM object to response.binarywrite large image data. For example, I've seen errors with ASPImage when a JPG file was over 575kb (though I don't know why an image that big would ever be on the web, much less in JPG format at all). One workaround would be to use a different object (maybe ADODB.Stream) to output the file; another would be to use smaller files.
Finally, see
Article #2099 if neither of the above situations applies to you.