K
karendy
Unregistered / Unconfirmed
GUEST, unregistred user!
程序中用TQuery+TUpdateSQL+TDateBase
程序运行不会报错,但是Insert一行时if Query1.Updatestatus = usInserted then这段不会执行,请大侠们帮忙看是哪里出了问题,谢谢
procedure TfmWorkShopLabdipReplyEdit.Query1AfterPost(DataSet: TDataSet);
begin
Panel1.Enabled := False;
Refresh.Click;
DataMD.D2003.StartTransaction;
try
Query1.ApplyUpdates;
if Query1.UpdateStatus = usInserted then
begin
case Query1Department_ID.AsInteger of //
26: SetSerialno('WSL_RplNZ_');
27: SetSerialno('WSL_RplNP_');
end; // case
end;
except // wrap up
Query1.Edit;
DataMD.D2003.Rollback;
Raise;
Exit;
end; // try/finally
Query1.CommitUpdates;
end;
程序运行不会报错,但是Insert一行时if Query1.Updatestatus = usInserted then这段不会执行,请大侠们帮忙看是哪里出了问题,谢谢
procedure TfmWorkShopLabdipReplyEdit.Query1AfterPost(DataSet: TDataSet);
begin
Panel1.Enabled := False;
Refresh.Click;
DataMD.D2003.StartTransaction;
try
Query1.ApplyUpdates;
if Query1.UpdateStatus = usInserted then
begin
case Query1Department_ID.AsInteger of //
26: SetSerialno('WSL_RplNZ_');
27: SetSerialno('WSL_RplNP_');
end; // case
end;
except // wrap up
Query1.Edit;
DataMD.D2003.Rollback;
Raise;
Exit;
end; // try/finally
Query1.CommitUpdates;
end;