标题:求助 vslistview的用法
只看楼主
claisen123
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2005-9-13
 问题点数:0 回复次数:1 
求助 vslistview的用法
谁知道vslistview的详细用法 ..麻烦提示下.!
搜索更多相关主题的帖子: vslistview 用法 
2005-09-22 17:40
可乐虫
Rank: 1
等 级:新手上路
帖 子:6
专家分:0
注 册:2006-3-11
得分:0 

Private Sub Form_Load()
ListView1.View = lvwReport
ListView1.GridLines = True
ListView1.ColumnHeaders.Clear
'ListView1.LabelEdit = lvwManual

ListView1.ColumnHeaders.Add , , "ID", 500
ListView1.ColumnHeaders.Add , , "姓名", 1000
ListView1.ColumnHeaders.Add , , "QQ", 1200
ListView1.ColumnHeaders.Add , , "MSN", 2500
ListView1.ColumnHeaders.Add , , "MAIL", 2000
ListView1.ColumnHeaders.Add , , "电话", 1500
ListView1.ColumnHeaders.Add , , "手机", 2000
ListView1.ColumnHeaders.Add , , "备注", 3000
Call ld

End Sub




Sub ld()
Dim con As ADODB.Connection
Dim rst As ADODB.Recordset
Dim liv As ListItem

Set con = New ADODB.Connection
Set rst = New ADODB.Recordset
con.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\DATA\DZ.MDB"
'rst.CursorLocation = adUseClient

rst.Open "SELECT * FROM TXL", con, adOpenStatic, adLockReadOnly
ListView1.ListItems.Clear
Do While Not rst.EOF
Set liv = ListView1.ListItems.Add(, , rst("ID"))
liv.SubItems(1) = rst("姓名")
liv.SubItems(2) = rst("QQ")
liv.SubItems(3) = rst("MSN")
liv.SubItems(4) = rst("MAIL")
liv.SubItems(5) = rst("电话")
liv.SubItems(6) = rst("手机")
liv.SubItems(7) = rst("备注")
rst.MoveNext
Loop
rst.Close
Set rst = Nothing
con.Close
Set con = Nothing

End Sub

2006-03-13 09:40



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-28383-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.114704 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved