PRB: ADO Does Not Return Records After an Update (197528)
The information in this article applies to:
- ActiveX Data Objects (ADO) 2.0
- ActiveX Data Objects (ADO) 2.01
- ActiveX Data Objects (ADO) 2.1 SP2
- ActiveX Data Objects (ADO) 2.5
- ActiveX Data Objects (ADO) 2.6
- ActiveX Data Objects (ADO) 2.7
This article was previously published under Q197528 SYMPTOMS When you issue an Update, Insert, or Delete statement
followed by a Select statement from an ADO client application, if you reference
the ADO Recordset object, you receive the following error:
Run-time error '3265':
ADO could not find the object in the
collection corresponding to the name or ordinal reference requested by the
application. The following error is returned from ADO 2.5 or later:
Run-time error '3265': Item cannot be found in the
collection corresponding to the requested name or ordinal. CAUSE The execution of the update statement against SQL Server
returns a message with the number of records affected by the Update, Insert, or
Delete statement (pcRowsAffected.) This number of records message will be
cached in the TDS stream. When the calling application checks for results, the
actual recordset will be waiting on the pipe after the records affected
message. RESOLUTION There are two possible workarounds to the this behavior:
- The first option is to provide a SET NOCOUNT ON statement prior to the Update statement. This would prevent the
records affected message from being returned at the end of each Update, Insert,
or Delete statement.
- The second option is to call the Next Recordsetmethod to process the actual recordset.
STATUS This behavior is by design. REFERENCES For additional information about SET NOCOUNT option, please refer to the Transact SQL Help and search for SET NOCOUNT.
Modification Type: | Minor | Last Reviewed: | 3/2/2005 |
---|
Keywords: | kbDatabase kbprb KB197528 |
---|
|