请各位大哥指点下ADO控件删除数据,谢谢
Private Sub cmd_del_Click()If Me.txt_c.Text = "" Then
MsgBox "删除条件不能为空!"
Exit Sub
End If
Adodc1.RecordSource = "select * from class where 姓名=" '&txt_c.text&"'"
If Adodc1.Recordset.RecordCount <= 0 Then
MsgBox "数据库中没有该项记录可供删除!"
Else
Adodc1.Recordset.Delete
DataGrid1.ReBind
DataGrid1.Refresh
MsgBox "删除成功!"
End If
End Sub
---------------------------------------------------
以上代码不知道哪错了?该删的记录没删掉,不该删的却被干掉了,急啊,请大哥们指正下,感激涕零!