把access中的数据写入VB中数状结构控键,要求在控键上显示。应该怎样写啊。 就像QQ上显示其好友一样 Private Sub Command1_Click()
Dim nodx As Node
Set nodx = TreeView1.Nodes.Add(, , "zf", "紫风无痕关系(双击收起)")
Set nodx = TreeView1.Nodes.Add("zf", tvwChild, "zfwife", "老婆")
Set nodx = TreeView1.Nodes.Add("zf", tvwChild, "zflover", "情人")
Set nodx = TreeView1.Nodes.Add("zf", tvwChild, "zffriend", "朋友")
Set nodx = TreeView1.Nodes.Add("zfwife", tvwChild, "lp1", "大老婆")
Set nodx = TreeView1.Nodes.Add("zfwife", tvwChild, "lp2", "二老婆")
Set nodx = TreeView1.Nodes.Add("zfwife", tvwChild, "lp3", "三老婆")
Set nodx = TreeView1.Nodes.Add("zfwife", tvwChild, "lp4", "四老婆")
Set nodx = TreeView1.Nodes.Add("zfwife", tvwChild, "lp5", "五老婆")
Set nodx = TreeView1.Nodes.Add("zflover", tvwChild, "qr1", "1号情人")
Set nodx = TreeView1.Nodes.Add("zflover", tvwChild, "qr2", "2号情人")
Set nodx = TreeView1.Nodes.Add("zflover", tvwChild, "qr3", "3号情人")
Set nodx = TreeView1.Nodes.Add("zffriend", tvwChild, "py1", "张三")
Set nodx = TreeView1.Nodes.Add("zffriend", tvwChild, "py2", "李四")
Set nodx = TreeView1.Nodes.Add("zffriend", tvwChild, "py3", "王麻子")
Set nodx = TreeView1.Nodes.Add("py1", tvwChild, "pylp1", "张三的老婆")
Set nodx = TreeView1.Nodes.Add("py1", tvwChild, "pylp2", "张三的孩子")
nodx.EnsureVisible
End Sub
比如也就是要求把 朋友这一项 写在数据库中 从数据库中那出来该怎样写呢谢谢拉
Dim nodx As Node
Set nodx = TreeView1.Nodes.Add(, , "zf", "紫风无痕关系(双击收起)")
Set nodx = TreeView1.Nodes.Add("zf", tvwChild, "zfwife", "老婆")
Set nodx = TreeView1.Nodes.Add("zf", tvwChild, "zflover", "情人")
Set nodx = TreeView1.Nodes.Add("zf", tvwChild, "zffriend", "朋友")
Set nodx = TreeView1.Nodes.Add("zfwife", tvwChild, "lp1", "大老婆")
Set nodx = TreeView1.Nodes.Add("zfwife", tvwChild, "lp2", "二老婆")
Set nodx = TreeView1.Nodes.Add("zfwife", tvwChild, "lp3", "三老婆")
Set nodx = TreeView1.Nodes.Add("zfwife", tvwChild, "lp4", "四老婆")
Set nodx = TreeView1.Nodes.Add("zfwife", tvwChild, "lp5", "五老婆")
Set nodx = TreeView1.Nodes.Add("zflover", tvwChild, "qr1", "1号情人")
Set nodx = TreeView1.Nodes.Add("zflover", tvwChild, "qr2", "2号情人")
Set nodx = TreeView1.Nodes.Add("zflover", tvwChild, "qr3", "3号情人")
Set nodx = TreeView1.Nodes.Add("zffriend", tvwChild, "py1", "张三")
Set nodx = TreeView1.Nodes.Add("zffriend", tvwChild, "py2", "李四")
Set nodx = TreeView1.Nodes.Add("zffriend", tvwChild, "py3", "王麻子")
Set nodx = TreeView1.Nodes.Add("py1", tvwChild, "pylp1", "张三的老婆")
Set nodx = TreeView1.Nodes.Add("py1", tvwChild, "pylp2", "张三的孩子")
nodx.EnsureVisible
End Sub
比如也就是要求把 朋友这一项 写在数据库中 从数据库中那出来该怎样写呢谢谢拉
解决方案 »
- 100分 求代码 关于 操作 网页
- 如何打开名称为اتباع بیگانه1.doc这样的文件
- A窗体调用B窗体,B关闭后,有必要在A中写上 set form_B =nothing吗?(一个窗体关闭,会在内存中释放吗?)
- 如何获得HTTP的头文件?
- 为什么不能用文本来读入这ini格式文件没反应?急,急,急
- 简单问题
- optionButton按钮在运行时如何去掉他默认的选中项
- 紧急求救,在线急等,网络数据库连接问题
- 为什么测试都过了关,可还是没录用我呢?
- DataGrid能与结果集绑定吗?怎么做?
- 在VB2005中,在删除DataGridView的指定行之后,数据库仍然存在那条记录
- 关于VB程序运行的问题,紧急求助啊!!
With Rs
Set .ActiveConnection = Cn
.CursorLocation = adUseClient
.CursorType = adOpenStatic
.LockType = adLockReadOnly
.Open "select * from 表1 "
if .eof=false then
Rs.MoveFirst
For i = 1 To Rs.RecordCount
Set nodx = TreeView1.Nodes.Add("zf", tvwChild, "zffriend" & CStr(i), Rs.Fields("朋友").Value)
Rs.MoveNext
Next
end if
end with
明天还有问题要问你们哦 希望你们多关照哈小弟啊 没办法小弟才入行
本来是今天想问的 结果到了网吧发现网吧安装的是office2003 郁闷死我了