PRB: ADO Delete Method May Delete More Rows Than Expected (294850)
The information in this article applies to:
- ActiveX Data Objects (ADO) 2.0
- ActiveX Data Objects (ADO) 2.1
- ActiveX Data Objects (ADO) 2.5
- ActiveX Data Objects (ADO) 2.6
- Microsoft Data Access Components 2.0
- Microsoft Data Access Components 2.1
- Microsoft Data Access Components 2.5
- Microsoft Data Access Components 2.6
- Microsoft Data Access Components 2.7
This article was previously published under Q294850 SYMPTOMS
The Delete method of the ActiveX Data Objects (ADO) Recordset object may delete more than the rows identified for deletion if the following conditions are true:
- You are connecting to SQL Server as a data source.
- You are using the MSDASQL OLE DB provider.
- The value of CursorType is not adOpenDynamic.
- Columns specified in the resultset do not contain a unique field.
- The table against which you are querying has no primary key.
If all of these conditions are met and a Delete method is called on the current record in the recordset, all matching records returned by the query (instead of just the current record) will be marked for deletion.
STATUS
This behavior is by design.
REFERENCESFor additional information, click the article number below
to view the article in the Microsoft Knowledge Base:
274551 HOWTO: Generate an ODBC Trace w/ ODBC Data Source Administrator
193946 HOWTO: Demo of ADO AddNew, Update, Delete, Find and Filter
| Modification Type: | Major | Last Reviewed: | 5/12/2003 |
|---|
| Keywords: | kbprb KB294850 |
|---|
|