listview控件添加数据库中的数据!!

yoxo 2003-05-09 05:03:38
我想在listview控件中添加数据库数据,listview有列头:题号,章节,内容;数据库表中有相应字段:题号,章节,内容。怎么把表中相应字段的数据添加到listview中???
...全文
169 1 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
w18ily 2003-05-09
  • 打赏
  • 举报
回复
:
While Not InfoRst.EOF
Set nListItem = lvListView.ListItems.Add(i, ShowType & Format(CStr(i), "000"), Format(CStr(i), "000"), "", "")

nListItem.SubItems(1) = InfoRst.Fields(0).Value
nListItem.SubItems(2) = InfoRst.Fields(1).Value
nListItem.SubItems(3) = InfoRst.Fields(2).Value)
nListItem.SubItems(4) = InfoRst.Fields(3).Value
nListItem.SubItems(5) = InfoRst.Fields(
4).Value
nListItem.Tag = "000"

InfoRst.MoveNext
i=i+1
Wend
InfoRst.Close

7,785

社区成员

发帖
与我相关
我的任务
社区描述
VB 基础类
社区管理员
  • VB基础类社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧