怎样把rs.Open查询的结果添加到LIST BOX控件里??
数据库已连接好,查询语句也对。但怎样把rs.Open查询的结果添加到LIST BOX控件里??
[解决办法]
do while not rs.eof
list1.additem rs( "field1 ")
...
rs.movenext
loop
[解决办法]
Data1.DataSource= "SELECT Name FROM <Name of the table here> " 'Do not include the brackets <> in the table name
Data1.Refresh
If Data1.Recordset.Recordcount> 0 Then 'Just make sure there is some data here
With Data1.Recordset
.MoveFirst
While Not .EOF=True
List1.AddItem !Name
.MoveNext
Wend
End With
End If
[解决办法]
do while not rs.eof
list1.additem rs( "field1 ")
...
doevents
rs.movenext
loop