Ver Mensaje Individual
  #2 (permalink)  
Antiguo 09/01/2002, 13:56
xtranio
 
Fecha de Ingreso: enero-2002
Mensajes: 59
Antigüedad: 23 años, 3 meses
Puntos: 0
Re: Error y no se que es

PRB: 80020009 Error When Retrieving Data from SQL
Last reviewed: October 20, 1997
Article ID: Q175239
The information in this article applies to:
ActiveX Data Objects (ADO), version 1.0
Microsoft Active Server Pages, version 1.0
Microsoft Visual InterDev, version 1.0


SYMPTOMS
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 SQL Server, you need to 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.

The code example below demonstrates the correct order of field selection:


<HTML>
<BODY bgcolor=white>
<%
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")

'open the connection
cn.Open "<Put your DSN here>"

'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>


espero te sirva,
saludos.