手把手教你使用VB來創(chuàng)建ASP組件(5)
發(fā)表時(shí)間:2023-08-11 來源:明輝站整理相關(guān)軟件相關(guān)文章人氣:
[摘要]5、 IsEof方法 IsEof方法是用來判斷是否還有更多的信息 其代碼如下 Private Function IsEof() As Boolean IsEof = RecordSetCD.EO...
5、 IsEof方法
IsEof方法是用來判斷是否還有更多的信息
其代碼如下
Private Function IsEof() As Boolean
IsEof = RecordSetCD.EOF
End Function
6、 NextCD 方法
NextCD方法的目的是返回當(dāng)前的CD信息,并將記錄集的指針向下移動(dòng),這可以通過MoveNext方法和IsEof配合使用來實(shí)現(xiàn)
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
好,我們已經(jīng)編寫好了組件,把它們編譯成CD.dll后,你最好把他們注冊一下 方法是在DOS界面下,輸入regsvr32 CD.dll