query1.sql.add('where ''' + 
combobox1.text + '''' +
' LIKE ''' +
edit.txt + '''' );

解决方案 »

  1.   

    Query.sql.add('where ' + combobox1.Text + 'like ''' + edit1.text + '''');
      

  2.   

    query1.sql.add('where combobox1.text like':p );
    query1.ParamByName('p').AsString :='%'+edit1.txt+'%';
      

  3.   

    var
    str:string;
    begin
    str:='select * from 表名 '+'where 条件';
    query1.close;
    query1.sql.add(select * from 表名);
    query1.execsql;
    end;
      

  4.   

    QUERY.SQL.ADD(' WHERE '+COMBOBOX1.TEXT+' LIKE '''+EDIT1.TEXT+'''')
    即可。
      

  5.   

    'where' +combobox1.text+'like'+#39+'%'+edit1.text+'%'+#39
      

  6.   

    Query1.Sql.Add('where '''+Combobox1.Text+''' like %'''+edit1.Text+'''');
      

  7.   


     
     
     
      CSDN - 专家门诊 - Delphi问题  
     回复 | 推荐 | 收藏 | 专题 | 公告 | 管理 | 关闭窗口  
     
     
     
    主  题:  SQL Server2000的简单问题!不够的下次补! 
    作  者:  wjohenw (天奇)  
    等  级:    
    信 誉 值:  100 
    所属论坛:  Delphi 
    问题点数:  100 
    回复次数:  9 
    发表时间:  2002-3-13 9:03:36 
       
     
       
    where combobox1.text like edit1,text; 
    怎么用query1.sql.add( )帮忙把括号内的写完,谢了! 
    正确的用分,不够再加! 
     
     回复人: windindance(风舞轻扬) (  ) 信誉:98  2002-3-13 9:06:48  得分:0  
     
     
      query1.sql.add('where ''' + 
    combobox1.text + '''' + 
    ' LIKE ''' + 
    edit.txt + '''' ); 
    Top 
     
     回复人: LXJ2001(lxj) (  ) 信誉:100  2002-3-13 9:07:33  得分:0  
     
     
      Query.sql.add('where ' + combobox1.Text + 'like ''' + edit1.text + ''''); 
    Top 
     
     回复人: outer2000(天外流星) (  ) 信誉:100  2002-3-13 9:07:45  得分:0  
     
     
      query1.sql.add('where combobox1.text like':p ); 
    query1.ParamByName('p').AsString :='%'+edit1.txt+'%'; 
    Top 
     
     回复人: My_first(海浪) (  ) 信誉:100  2002-3-13 9:08:32  得分:0  
     
     
      var 
    str:string; 
    begin 
    str:='where '+Combobox1.Text+'like '+''''+edit1.Text+''''; 
    query1.close;
    query1.sql.clear; 
    query1.sql.add(str); 
    query1.open; 
    end; 
     
      

  8.   

    var 
    str:string; 
    begin 
    str:='where '+Combobox1.Text+' like '+''''+edit1.Text+''''; 
    query1.close; 
    query1.sql.clear; 
    query1.sql.add(str); 
    query1.open; 
    end;