程序声明错误

时间:2014-12-02 20:07:09

标签: vb6

作为VB6新手,我正在尝试更新应用程序的旧版本。但是,出现以下代码:

程序声明与具有相同名称的事件或程序的描述不匹配

以下是代码段:

Private Sub ppdatPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, 
ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, 
ByVal pRecordset As ADODB.Recordset)

Dim Position As Long
Position = datPrimaryRS.Recordset.AbsolutePosition
If Position = -1 Then Position = 0
datPrimaryRS.Caption = "Record: " & CStr(Position)
End Sub

错误指向此行:

Private Sub ppdatPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, ByVal pRecordset As ADODB.Recordset)

任何帮助将不胜感激

1 个答案:

答案 0 :(得分:2)

正确的签名应该是:

Private Sub ppdatPrimaryRS_MoveComplete(ByVal adReason As ADODB.EventReasonEnum, _
    ByVal pError As ADODB.Error, adStatus As ADODB.EventStatusEnum, _
    ByVal pRecordset As ADODB.Recordset20)

更多信息:

http://support.microsoft.com/kb/222145

http://www.vbmigration.com/detknowledgebase.aspx?Id=105