5、 ISEOf方法
ISEOf方法是用來判斷是否還有更多的信息
其代碼如下
PRivate Function ISEOf() As Boolean
ISEOf = RecordSetCD.EOF
End Function
6、 NextCD 方法
NextCD方法的目的是返回當前的CD信息,並將記錄集的指針向下移動,這可以通過MoveNext方法和ISEOf配合使用來實現
Private Sub NextCD(Id As Variant, Name As Variant, Author As Variant, Price As Variant, Information As Variant)
On Error Resume Next
If ISEOf = True Then
Err.Raise vbObject + 1, "CD Information", "End of cursor"
Exit Sub
End If
Id = RecordSetCD.FIElds("CD_ID")
Name = RecordSetCD.FIElds("CD_Name")
Author = RecordSetCD.FIElds("CD_Author")
Price = RecordSetCD.FIElds("CD_Price")
Information = RecordSetCD.FIElds("CD_Information")
RecordSetCD.MoveNext
End Sub
好,我們已經編寫好了組件,把它們編譯成CD.dll後,你最好把他們注冊一下 方法是在DOS界面下,輸入regsvr32 CD.dll