手把手教你使用VB来创建ASP组件(5)
程序员文章站
2022-05-23 08:57:30
5、 iseof方法
iseof方法是用来判断是否还有更多的信息
其代码如下
private function iseof() as boolean...
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
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