query1.Close;
query1.sql.Clear;
query1.sql.Add('select sum(je) as je1,sum(zzje)as zzje1,sum(sl) as sl1  from xiaoshouz where rq=:d');
query1.ParamByName('da').AsDateTime:=date();
query1.open  ;
执行后总是报'TABLE IS READ ONLY',这是为何? query1.requestlive:=true,请高手指教

解决方案 »

  1.   

    你的参数是da,但你引用写的是:d
      

  2.   

    这是笔误,将where后去除,报同样错,改成'select * from xiaoshouz'就不报错
      

  3.   

    因为你查询的数据中没有 da 这一项
    改成
    query1.sql.Add('select sum(je) as je1,sum(zzje)as zzje1,sum(sl) as sl1,da  from xiaoshouz where rq=:da'); 
      

  4.   


    这是一个只读数据集,为什么要设置 RequestLive ??
      

  5.   

    将query1的requestlive的性质改为false就通过了,但还是不知道原因何在?