VB怎样删除数据库全部记录?

2025-04-15 04:19:15
推荐回答(1个)
回答1:

下面语句刚刚做成,并通过测试。
Private Sub Command5_Click()
If (Adodc1.Recordset.BOF Or Adodc1.Recordset.EOF) Then
MsgBox "无记录可删除", , "提示"
End If
While Not Adodc1.Recordset.EOF()
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
Wend
MsgBox "记录已经全部清除!", vbOKOnly, "提示"
End Sub