查出“部门”字段有哪几种可能的值,并将其传送给list控件啊??

解决方案 »

  1.   

    select distinct 部门 from 表 
    是这样吗?
      

  2.   

    rs.open("select distinct 部门 from 表",conn)
    do not rs.eof
    listbox1.additem rs.field("部门")
    loop
      

  3.   

    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
      

  4.   

    对不起,少写了些东西啊!呵呵~~
    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
      

  5.   

    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