还有就是我的这个SQL是动态的,select a as 编号,b as 学生名,c as 成绩,... from 表
我的SQL是根据一个纵表展开为横表的,所以是动态的. For i = 1 To rs.Fields.Count lvwList.ColumnHeaders.Add , , rs.Fields(i - 1).Name
For x = 1 To rs.RecordCount Set itmx = lvwList.ListItems.Add(, , rs.Fields(0)) lvwList.ListItems(x).SubItems(i) = rs.Fields(i) '这里提示无效的属性 Next x Next i
dim rst as recordset set rst = conn.execute("select * from 表") do while not rst.eof listview1.listitems.add rst!列名 rst.movenext loop rst.close set rst=nothing conn.close set conn=nothing
For i = 1 To rs.Fields.Count
lvwList.ColumnHeaders.Add , , rs.Fields(i - 1).Name
For x = 1 To rs.RecordCount
Set itmx = lvwList.ListItems.Add(, , rs.Fields(0))
lvwList.ListItems(x).SubItems(i) = rs.Fields(i) '这里提示无效的属性
Next x
Next i
set rst = conn.execute("select * from 表")
do while not rst.eof
listview1.listitems.add rst!列名
rst.movenext
loop
rst.close
set rst=nothing
conn.close
set conn=nothing