利用 TEXT1 COMBO1 和ADODC1 查询数据库 部分代码如下 
 
    IF  TEXT1.TEXT <>"" AND  COMBO1.TEXT="姓名" then 
adodc1.recordsource="select * from kehu where xingming ="text1.text""  '提示没有结束语句
END IF  
请大家帮忙看一下是怎么回事, 语句那有问题

解决方案 »

  1.   

    adodc1.recordsource="select * from kehu where xingming =text1.text" 
    text1.text本身就是字符串。
      

  2.   

    adodc1.recordsource="select * from kehu where xingming ='"& text1.text &"'"
    adodc1.refresh 
      

  3.   

    adodc1.recordsource="select * from kehu where xingming ='" & text1.text & "'"
      

  4.   

    多谢大家  
    还有我想把查出的数据在DATAGRID1中显示 请问怎么写
    一会加分
      

  5.   

    adodc1.recordsource="select * from kehu where xingming =" & "'" & text1.text & "'"
      

  6.   

    adodc1.recordsource="select * from kehu where xingming = '" & Trim(text1.Text) & "'"