procedure Tfm_quy_water.btn_wspfzlqnClick(Sender: TObject);
begin
with dm_land do
begin
quy_djnd.Close;
quy_djnd.SQL.Clear;
quy_djnd.SQL.Add('select id from djnd where djnd like "%'+edit_year.Text+'%"');
quy_djnd.RequestLive:=true;
quy_djnd.Open; quy_wspf.Close;
quy_wspf.SQL.Clear;
quy_wspf.SQL.Add('select sum(wspfl) from wspf,djnd where wspf.id=djnd.id');
quy_wspf.RequestLive:=true;
quy_wspf.Open;
edit_sum_pfl.Text:=quy_wspf.Fields[0].Value;
end;
end;错误提示 table id read only!
begin
with dm_land do
begin
quy_djnd.Close;
quy_djnd.SQL.Clear;
quy_djnd.SQL.Add('select id from djnd where djnd like "%'+edit_year.Text+'%"');
quy_djnd.RequestLive:=true;
quy_djnd.Open; quy_wspf.Close;
quy_wspf.SQL.Clear;
quy_wspf.SQL.Add('select sum(wspfl) from wspf,djnd where wspf.id=djnd.id');
quy_wspf.RequestLive:=true;
quy_wspf.Open;
edit_sum_pfl.Text:=quy_wspf.Fields[0].Value;
end;
end;错误提示 table id read only!
select sum(wspfl) as sumwspfl from wspf,djnd where wspf.id=djnd.id'
........edit_sum_pfl.Text:=quy_wspf.fieldByName('sumwspfl').asString;
quy_wspf.fields[0].asstring;