以下语句有何错误?query1.close;
query1.sql.clear;
query1.sql.add('select * from table1 where col1>strtofloat(edit1.text)');
query1.sql.open;

解决方案 »

  1.   

    query1.sql.add('select * from table1 where col1>'''+strtofloat(edit1.text)+'''');试看
      

  2.   

    query1.close;
    query1.sql.clear;
    query1.sql.add('select * from table1 where col1>edit1.text');
    query1.sql.open;如果是MS-SQL里面有类型转换函数,不能用strtofloat()这些了,
      

  3.   

    如果是MS-SQL里面有类型转换函数,不能用strtofloat()这些了,这个很对一般都要转为XXToStr()
      

  4.   

    query1.sql.add('select * from table1 where col1>'+strtofloat(edit1.text));
      

  5.   

    上面的写错了
    干脆这样:
    query1.sql.add('select * from table1 where col1>'+edit1.text);
      

  6.   

    query1.sql.add('select * from table1 where col1>strtofloat(edit1.text)');这句有错,
    应该写成:
    query1.sql.add('select * from table1 where col1>'+strtofloat(edit1.text)'+')';"strtofloat(edit1.text)"是交给DELPHI处理的,处理完后才可以组装成SQL语句传递给SQL