to bucher:
我没有对Microsoft Common Controls 5.0的引用,我一直只引用引用Microsoft Common Controls 6.0,我已试过改为Private Sub listStudents_ItemClick(ByVal Item As ListItem)。结果还是一样。后来,在access 2000数据库中我把学号这个属性的类型由整数改为
改为文本,就好了!
in VB, Project->Components, find Microsoft Windows Common Controls 6.0 (if you do not see it, browser to System directory, find MSCOMCTL.OCX), select it, you will a few entries (like listcontrol, tree control, image control, etc.) are added to your toolbox
我回去试过,只要把Private Sub listStudents_ItemClick(ByVal Item As ComctlLib.ListItem)
改为Private Sub listStudents_ItemClick(ByVal Item As MSComctlLib.ListItem)
经过测试,可以肯定MSComctlLib.ListItem,是对的,ComctlLib.ListItem是错的.
然后,把rs.Open "select * from student where 学号= '"+Item.Key+ "'" ,mConn,adOpenForwardOnly, adLockReadOnly