数值型应该如此:
form47.adoQuery1.sql.add('select * from table1 where 编号='+Edit1.text);模糊查询?数值型还是用范围吧(大于、小于等)

解决方案 »

  1.   

    說具體點,是什麼數據類型的,是char嗎
    用like 和=進行模糊和精確查詢
      

  2.   

    where 编号 = 'AAA' //精确
    where 编号 = '%AAA%' //模糊
      

  3.   

    实现精确查询:
    form47.adoQuery1.Close;
    form47.adoquery1.sql.Clear;
    form47.adoQuery1.sql.add('select * from table1 where 编号='+Edit1.text);
    form47.adoQuery1.Open;模糊查询form47.adoQuery1.Close;
    form47.adoquery1.sql.Clear;
    form47.adoQuery1.sql.add('select * from table1 where cast(编号 as VARCHAR(10)) like =''%'+Edit1.text+'%''');
    form47.adoQuery1.Open;
      

  4.   

    数值型应该用范围:
    form47.adoQuery1.sql.add('select * from table1 where 编号>'+Edit1.text+ ' and '+ '编号<'+Edit2.text );