vb几个语句解释

来源:百度知道 编辑:UC知道 时间:2024/06/25 21:54:49
Private Sub Command1_Click()
Dim res As Integer
res = MsgBox("确定删除此行记录吗?", vbExclamation + vbYesNo + vbDefaultButton1)
If res = vbYes Then
Adodc1.Recordset.Delete
Adodc1.Recordset.MoveNext
MsgBox "删除成功"
If Adodc1.Recordset.EOF = True Then
Adodc1.Recordset.MoveLast
End If
End If
End Sub
==================================
If res = vbYes Then从这句开始看下面的语句
下面好像是数据库的东西,不是很清楚
Adodc1.Recordset.EOF
Adodc1.Recordset.MoveNext
讲解一下,谢谢

Adodc1.Recordset.Delete '删除本条记录
Adodc1.Recordset.MoveNext ’移动记录集至下一条记录

Adodc1.Recordset.EOF ’检测是否到最后一条记录
Adodc1.Recordset.MoveNext ’移动记录集至下一条记录

Adodc1.Recordset.EOF ’检测是否到最后一条记录
Adodc1.Recordset.MoveNext ’移动记录集至下一条记录
这是最正确的

如果弹出对话框 点了确定。那么删除本条纪录。纪录往后移一行,弹出删除成功,如果纪录移到最后为真,那么纪录移动到最后一条