VBA6 中的 ADODB RecordsetChangeComplete 事件处理程序声明

ADODB RecordsetChangeComplete event handler declaration in VBA6

VBA6 中 RecordsetChangeComplete ADODB.Recordset 事件处理程序的正确声明是什么?

对象浏览器的版本

Private WithEvents AdoRecordset As ADODB.Recordset

Private Sub AdoRecordset_RecordsetChangeComplete( _
            adReason As EventReasonEnum, _
            pError As Error, _
            adStatus As EventStatusEnum, _
            pRecordset As Recordset)
End Sub

导致“过程声明与具有相同名称的事件或过程的描述不匹配”。

这是我允许 VBA 生成事件时得到的结果。注意 ByVal 的:

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

End Sub