VB怎样活用list

来源:百度知道 编辑:UC知道 时间:2024/06/15 19:57:25
用一个文本框输入一个ACCESS数据库的一个表里某字段(如学号),然后LIST里显示此学号的人的所有信息要怎么写呀

dim i as integer
Adodc1.recordsoure="select * from 表名"
Adodc1.refresh
for i=0 to 表名.fields.count
if text1.text=表名.fields(i).name then
msgbox "表中有这个字段名!"
exit for
endif
next
Adodc1.recordset.movefirst
do while not Adodc1.recordset.eof
list1.add Adodc1.recordset.field("text1.text")
Adodc1.recordset.movenext
loop