var 
   cat,dep:String
cat:=...
dep:=...SQL.Text:= 'select 仪器编号,仪器名称 from table where (分类号='+''''cat''''+')and (部门代码='+''''dep''''+')'在cat和dep这里有错,请各位高手帮我看一下错在哪里,谢谢

解决方案 »

  1.   

    SQL.Text:= 'select 仪器编号,仪器名称 from table where (分类号='''+cat+''') and  (部门代码='''+dep+''')' ;
      

  2.   

    'select 仪器编号,仪器名称 from table where (分类号="'+cat+'"')and (部门代码="'+dep +'")'
      

  3.   

    'select 仪器编号,仪器名称 from table where (分类号="'+cat+'")and (部门代码="'+dep +'")'
      

  4.   

    SQL.Text:= 'select 仪器编号,仪器名称 from table where (分类号='' '+ cat +' '') and  (部门代码='' '+ dep +' '')' ;
      

  5.   

    'select 仪器编号,仪器名称 from table where 分类号='''+cat+''' and 部门代码='''+dep+''''