当前位置: 首页 > 图文教程 > 网络编程 > ASP > 手把手教你使用VB来创建ASP组件(5)

ASP
ubb代码的简单实现
在VS.NET中编写Web应用程序(一)
在VS.NET中编写Web应用程序(二)
在VS.NET中编写Web应用程序(三)
ASP.NET编程实例ABC(1)
ASP.NET编程实例ABC(2)
ASP.NET编程实例ABC(3)
亲密接触ASP.Net(8)
亲密接触ASP.Net(9)
ASP.NET重用代码技术 - 代码绑定技术
ASP.NET重用代码技术 - 用户控件技术
在ASP.NET中使用.NET组件
用XSL.ASP编辑XML文档(1)
用XSL.ASP编辑XML文档(2)
亲密接触ASP.Net(10)
亲密接触ASP.Net(11)
亲密接触ASP.Net(12)
亲密接触ASP.Net(13)
亲密接触ASP.Net(14)
亲密接触ASP.Net(15)

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


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2009-11-03   浏览: 25 ::
收藏到网摘: n/a

  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