Private Sub Command6_Click()
If rstu.RecordCount = 0 Then
MsgBox "没有可删除的记录", vbExclamation + vbOKOnly, "操作提示"
Exit Sub
End If
If MsgBox("确实要删除当前记录吗?", vbQuestion + vbYesNo, "操作提示") = vbNo Then
Exit Sub
End If
rstu.Delete
If rstu.RecordCount > 0 Then
rstu.MoveLast
If rstu.EOF Then
rstu.MoveLast
End If
End If
end sub我后来想重新刷新下数据库 如代码:
rstu.Close
Dim strsql As String
strsql = "select * from tooluse order by tubh "
rstu.Open strsql, conn, adOpenStatic, adLockOptimistic
Set DataGrid1.DataSource = rstu
可问题还解决不了