你edit1里输入正确吗?
要不
query1.parambyname('x')..AsFloat:=strtofloast(edit1.text);

解决方案 »

  1.   

    这样写看看
    query1.parambyname('x').asreal:=strtoreal(edit1.text)
    或许能行
      

  2.   

    query1.parambyname('x').AsFloat:=strtofloast(edit1.text); 
      

  3.   

    刚才写错了 应该和方恨少的同样 
    query1.parambyname('x').asfloat:=floattostr(edit1.text)
      

  4.   

    Query1.fieldbyname('x').asfloat:=strtofloat(edit.text);建议:最好不要利用这种直接赋值的方法。给你一个例子。
    procedure ExeOpenQuery;
    var
      tempstr:string;
    begin
      tempstr:='insert into ....‘;
      openquery(tempstr,query1,false);
    end;procedure openquery(astr:string;aQuery:TQuery;flag:Boolean);
    begin
      with aQuery do
        begin
          close;
          sql.clear;
          sql.add(astr);
          if flag then
            open
          else
            execsql;
        end;
    end;
    这种写法的最大的优点就是便于跟踪。
      

  5.   

    Query1.fieldbyname('x').asfloat:=strtofloat(edit.text);建议:最好不要利用这种直接赋值的方法。给你一个例子。
    procedure ExeOpenQuery;
    var
      tempstr:string;
    begin
      tempstr:='insert into ....‘;
      openquery(tempstr,query1,false);
    end;procedure openquery(astr:string;aQuery:TQuery;flag:Boolean);
    begin
      with aQuery do
        begin
          close;
          sql.clear;
          sql.add(astr);
          if flag then
            open
          else
            execsql;
        end;
    end;
    这种写法的最大的优点就是便于跟踪。
      

  6.   

    不用那么复杂吧,这样行
    query1.parambyname('x').value:=edit1.text;
    不过你的程序没有错误(在WIN98)上,
    我试过,可能是,你在移植程序吧。(到NT上)
    你的程序,好象会有,一些错误,(莫名其妙的);
    如果你的程序是在98上的写的,就出错,那么
    应该是你的,DELPHI有问题,可能是
    BDE