手把手教你使用VB来创建ASP组件(5) 

资讯 驱动中国 686次阅读
分享 Q

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 

版权声明:本文由驱动中国整理发布,转载需注明出处与原文链接。如有疑问请联系 editor@qudong.com
本文价值 成为第一个评分的人
登录后为本文打分
网友评论0 条评论
正在回复 的评论取消
评论加载中…
🔐

登录后参与互动

评论、点赞均可赚积分
连续签到、邀请好友也有奖励 🎁

电脑端: 微信扫码登录 微信内: 一键登录
我要投稿有独家观点或行业线索?向驱动中国投稿,审核采用后署名发布并获积分奖励。 去投稿 ›

微信扫一扫

打开微信「扫一扫」,分享本文到朋友圈或好友