http://support.microsoft.com/support/kb/articles/Q175/2/39.ASPSYMPTOMS
The following error occurs when accessing a recordset in an Active Server Pages (ASP) file that contains \"Text\" or \"Blob\" type data from a SQL table:
Microsoft OLE DB Provider for ODBC Drivers error \'80020009\'
CAUSE
The following condition may cause the error to occur:
Text/Blob fields are selected in an order preceding other types of fields.
RESOLUTION
When dealing with BLOB fields from Microsoft SQL Server, you must put them to the right of non-BLOB columns in the resultset. To be safe, you should also read the columns in left-to-right order, so if you have two BLOB columns as the last two columns in your resultset, read the first one and then the second. Do not read them in the reverse order.
To demonstrate the correct order of field selection create a new ASP page in a Visual InterDev Project and paste the following code in the blank ASP page. Modify the connection string to connect to your SQL Server:
<%@ Language=VBScript %>
<HTML>
<BODY bgcolor=white>
<%
Set cn = Server.CreateObject(\"ADODB.Connection\")
Set rs = Server.CreateObject(\"ADODB.Recordset\")
\'Open the connection.
cn.Open \"dsn=yoursystemdsn;uid=sa;pwd=;database=pubs;\"
\'Open the recordset.
\'Notice that the Blob field, pr_info, is last in the field order.
rs.Open \"select pub_id, pr_info from pub_info\", cn
While Not rs.EOF
Response.Write \"<P>PR Info:<P>\" & rs(\"pr_info\")
Response.Write \"<P>That was the PR Info for PubID \" &
rs(\"pub_id\")
rs.MoveNext
Wend
%>
</BODY>
</HTML>
STATUS
This behavior is by design. However, it does not occur when using Mdac 2.1sp2 or later with the 3.7 driver or later for SQL Server.
You can download the latest version of Microsoft Data Access Components from the following Microsoft Web site:
http://www.microsoft.com/data/download.htm