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 编辑 ]