求助!!!那位大虾指点一下
Dim db as adodb.connection Dim rs as adodb.recordset Dim mitem as listitem Set db = new adodb.connection Set rs = new adodb.recordset With db .provider=”sqloledb” .open “datasource=lab2; uid=sa;pwd=;initial catalog=northwind;” End with rs.open “select productname from products”, db,adopenstatic,adlockoptimistic Do until re.eof Set mitem=lvwproducts.listitems.add() mitem.text=rs!productname rs.movenext Loop lvwproducts是列表视图控件,上述代码不能正确运行,原因不可能是(选择一项) | |
a) |
没有添加columnheaders |
b) |
Lvwproducts的listitems没有清空 |
c) |
mitem.text=rs!productname错误,应该为mitem.text=rs.fields(“productname”).value |
d) |
listitem对象mitem没有用new关键字动态生成 |