procedure Tf_add.BitBtn4Click(Sender: TObject); begin if messagedlg('请确认要保存对此纪录的修改吗?',mtConfirmation, [mbYes, mbNo],0)=mryes then begin f_dm.ADOQuery1.Active:=false; f_dm.ADOQuery1.SQL.Text:='select * from ygxx1,ygxx2,ygxx3 where ygxx1.dh=''+Edit27.Text+'' and ygxx2.dh=''+Edit27.Text+'' and ygxx3.dh=''+Edit27.Text+''; f_dm.ADOQuery1.Active:=true; f_dm.ADOQuery1.Edit; f_dm.ADOQuery1.FieldByName('xm').AsString:=Edit2.Text; f_dm.ADOQuery1.FieldByName('xb').AsString:=Edit11.Text; f_dm.ADOQuery1.FieldByName('mz').AsString:=Edit3.Text; f_dm.ADOQuery1.FieldByName('jg').AsString:=Edit4.Text; ………… f_dm.ADOQuery1.Post; end; end;
f_dm.ADOQuery1.SQL.Text:='select * from ygxx1,ygxx2,ygxx3 where ygxx1.dh=''+Edit27.Text+'' and ygxx2.dh=''+Edit27.Text+'' and ygxx3.dh=''+Edit27.Text+'';
看上去有點別扭, f_dm.ADOQuery1.SQL.Text:='select ygxx1.*,ygxx2.*,ygxx3.* from ygxx1,ygxx2,ygxx3 where ygxx1.dh=ygxx2.dh and ygxx1.dh=ygxx3.dh and ygxx1.dh=''+Edit27.Text+''; 你先用dbgrild顯示看看查詢的結果﹐
----------------------------------------------
-