Private Sub MSHFGrid_Click()
MSHFGrid.Row = MSHFGrid.RowSel
End Sub
If MsgBox("你确定删除编号为:[" & MSHFGrid.Text & "] ?", vbQuestion + vbYesNo, "删除") = vbYes Then
Set ResDel = New ADODB.Recordset
ResDel.Open "delete from UserInfo where UserId='" & MSHFGrid.Text & "'", Conn, 1, 2
MsgBox "删除成功!", vbInformation, "成功"
If ResDel.State <> 0 Then ResDel.Close
ResDel.Open "select * from viewUserInfo", Conn, 1, 1
Set MSHFGrid.DataSource = ResDel
If ResDel.State <> 0 Then ResDel.Close
Set ResDel = Nothing
End If
还有什么不懂的 可以再问我
温馨提示:答案为网友推荐,仅供参考