P
pzning
Unregistered / Unconfirmed
GUEST, unregistred user!
我写了几行代码,不能通过请大家帮忙看一下,谢了。
我的本意是想,删除这个数据,把附数据库中的关联的数据也删除。请多指点
procedure Tkhgl.XP_Button2Click(Sender: TObject);
begin
if not adoquery2.eof then
begin
adoquery2.delete;
adoquery2.Close;
adoquery2.open;
end
else
if adoquery2.eof then
begin
showmessage('数据为空不能删除!');
end
while not adotable2.Eof do
begin
if adotable2['固定id']=adoquery2['自动编号'] then
adotable2.delete;
end
else adotable1.Next;
end;
end;
我的本意是想,删除这个数据,把附数据库中的关联的数据也删除。请多指点
procedure Tkhgl.XP_Button2Click(Sender: TObject);
begin
if not adoquery2.eof then
begin
adoquery2.delete;
adoquery2.Close;
adoquery2.open;
end
else
if adoquery2.eof then
begin
showmessage('数据为空不能删除!');
end
while not adotable2.Eof do
begin
if adotable2['固定id']=adoquery2['自动编号'] then
adotable2.delete;
end
else adotable1.Next;
end;
end;