VB6.0中如何用按钮删除DataGrid显示的一行记录
我连接的SQL数据库这是我的代码用的ADODC连接数据库这是前面的代码看不太懂(照着参考书写的)PrivateSubAdodc1_MoveComplete(_ByVala...
我连接的SQL数据库 这是我的代码 用的ADODC连接数据库
这是前面的代码 看不太懂 (照着参考书写的)Private Sub Adodc1_MoveComplete( _
ByVal adReason As ADODB.EventReasonEnum, _
ByVal pError As ADODB.Error, _
adStatus As ADODB.EventStatusEnum, _
ByVal pRecordset As ADODB.Recordset)
Adodc1.Caption = "Record: " & _
CStr(Adodc1.Recordset.AbsolutePosition)
End Sub
这是删除按钮的代码
Private Sub CmdDelete_Click()
On Error GoTo DeleteErr
With Adodc1.Recordset
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
错误提示是“对象变量或with块变量未设置”
哪里不对希望指导 展开
这是前面的代码 看不太懂 (照着参考书写的)Private Sub Adodc1_MoveComplete( _
ByVal adReason As ADODB.EventReasonEnum, _
ByVal pError As ADODB.Error, _
adStatus As ADODB.EventStatusEnum, _
ByVal pRecordset As ADODB.Recordset)
Adodc1.Caption = "Record: " & _
CStr(Adodc1.Recordset.AbsolutePosition)
End Sub
这是删除按钮的代码
Private Sub CmdDelete_Click()
On Error GoTo DeleteErr
With Adodc1.Recordset
.Delete
.MoveNext
If .EOF Then .MoveLast
End With
Exit Sub
DeleteErr:
MsgBox Err.Description
End Sub
错误提示是“对象变量或with块变量未设置”
哪里不对希望指导 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询