rs.open("select distinct 部门 from 表",conn) do not rs.eof listbox1.additem rs.field("部门") loop
dim Con as new adodb.connection dim Rs as new adodb.recordset Con.open 你自己的连库语句; Rs.open "Select distinct 部门 from 表" while not Rs.eof list1.additem Rs("部门") Rs.movenext wend
对不起,少写了些东西啊!呵呵~~ dim Con as new adodb.connection dim Rs as new adodb.recordset Con.open 你自己的连库语句; Rs.open "Select distinct 部门 from 表",Con,1,3 while not Rs.eof list1.additem Rs("部门") Rs.movenext wend
dim Con as new adodb.connection dim Rs as new adodb.recordset Con.open 你自己的连库语句; Rs.open "Select distinct 部门 from 表",Con,1,3 while not Rs.eof list1.additem Rs("部门") Rs.movenext wend
是这样吗?
do not rs.eof
listbox1.additem rs.field("部门")
loop
dim Rs as new adodb.recordset
Con.open 你自己的连库语句;
Rs.open "Select distinct 部门 from 表"
while not Rs.eof
list1.additem Rs("部门")
Rs.movenext
wend
dim Con as new adodb.connection
dim Rs as new adodb.recordset
Con.open 你自己的连库语句;
Rs.open "Select distinct 部门 from 表",Con,1,3
while not Rs.eof
list1.additem Rs("部门")
Rs.movenext
wend
dim Rs as new adodb.recordset
Con.open 你自己的连库语句;
Rs.open "Select distinct 部门 from 表",Con,1,3
while not Rs.eof
list1.additem Rs("部门")
Rs.movenext
wend