txtSQL = "select 名称 from 学生表 where 号码="+combobox.text

解决方案 »

  1.   

    什么意思啊,怎么放入text中呢,继续啊
      

  2.   

    dim ac_tmp    as new adodb.connection
    dim ar_tmp    as new adodb.recordset
    with ac_tmp
    ...
    ...
    end withtxtSQL = "select 名称 from 学生表 where 号码='"& combobox.text &"'"
    with ar_tmp
        if .state=adstateopen then .close
        .open txtSQL,ac_tmp,adopenkeyset,adlockreadonly
    end withif ar_tmp.recordcount>0 then
        text.text=ar_tmp!名称 
    else
        text.text=""
    endif
    ar_tmp.close
      

  3.   

    mrc.find "号码='"+combobox.text+"'"
    if not mrc.eof then
       text.text=mrc.fields("名称").value
    end if