标题:ADO输出到LISTVIEW错误
取消只看楼主
xxyyx82
Rank: 1
等 级:新手上路
帖 子:22
专家分:3
注 册:2015-7-16
结帖率:50%
已结贴  问题点数:20 回复次数:0 
ADO输出到LISTVIEW错误
程序代码:
Private Sub Form_Load()
Dim con As Object
Dim rs As Object
Set con = CreateObject("ADODB.Connection")
Set rs = CreateObject("ADODB.Recordset")
con.ConnectionString = "Provider=Microsoft.Jet.OLEDB.4.0;Persist Security Info=False;Data Source='F:\订单一览表.xls';Extended Properties='Excel 8.0;HDR=Yes'"
con.Open
Sql = "select * from [Page1$]"
rs.Open Sql, con, 3, 3

Do While Not rs.EOF
Set Item = ListView1.listitems.Add()
Item.Text = rs.fields(0)
For i = 2 To rs.Recordcount - 1
Item.SubItems(1) = rs.fields(i)
Next
rs.movenext
Loop

rs.Close
Set rs = Nothing
con.Close
Set con = Nothing
End Sub


Item.SubItems(1) = rs.fields(i) 提示无效的属性值,哪里出的问题,请各位帮忙指导下,小弟新手,谢谢。

[ 本帖最后由 xxyyx82 于 2015-7-19 20:24 编辑 ]
2015-07-19 20:22



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




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

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