hi,
The attached sample is use ADO data control to maintain data. But my delete method of the ADO data control can not work. I have the error: Multiple-steps operations generated errors. Check each status value. Please help !
Printable View
hi,
The attached sample is use ADO data control to maintain data. But my delete method of the ADO data control can not work. I have the error: Multiple-steps operations generated errors. Check each status value. Please help !
This required a little research. It seems that when using the ADO Data Control, you have to Bookmark the record before it can be deleted. Make the following change to your code, and you should be just fine.VB Code:
Private Sub cmdDelete_Click() Dim str As Byte str = MsgBox("Are you sure you want to delete this record?", vbQuestion + vbYesNo) If str = vbYes Then With Adodc1.Recordset .Bookmark = .Bookmark '<==== ADD THIS LINE TO YOUR ROUTINE .Delete 'change current record If .RecordCount > 0 Then If .BOF Then .MoveFirst Else .MovePrevious End If Else ''Record count = 0 UpdateButtons End If End With End If End Sub
You are right. I add the Bookmark to the record before deleted it and it work.
Thank you very much for your help. :wave: