Q
qinmingzsj
Unregistered / Unconfirmed
GUEST, unregistred user!
各位大俠:
我的程序在按 "保存"時,有時出現"NO USER TRANSACTION IS CURRENTLY IN PROGRESS "
這個提示,我不知道問題出在哪里,希望能給我一點提示!
我的原代碼如下:
if GSDDATAMOD.GSDCUSTDB.InTransaction = true then
GSDDATAMOD.GSDCUSTDB.RollBack;
GSDDATAMOD.GSDCUSTDB.StartTransaction;
Qry_GS_MAKEHEAD.ApplyUpdates;
arraytoqry(Qry_GS_COLOR_CODEDOC_insert, Qry_GS_MAKEHEAD);(這個函數是表Qry_GS_MAKEHEAD 里插入數據)
Qry_GS_COLOR_CODEDOC_insert.ApplyUpdates;
Qry_GS_MERCERYDOC_insert.ApplyUpdates;
// Qry_GS_SIZESPECDOC_insert.ApplyUpdates;
GSDDATAMOD.GSDCUSTDB.Commit;
Qry_GS_COLOR_CODEDOC_insert.CommitUpdates;
Qry_GS_MERCERYDOC_insert.CommitUpdates;
Qry_GS_COLOR_CODEDOC.ParamByName('computer_id').AsString := Qry_GS_MAKEHEAD.FieldBYNAME('COMPUTER_ID').AsString;
Qry_GS_COLOR_CODEDOC.close;
Qry_GS_COLOR_CODEDOC.Open;
Qry_GS_MERCERYDOC.ParamByName('computer_id').AsString := Qry_GS_MAKEHEAD.FieldBYNAME('COMPUTER_ID').AsString;
Qry_GS_MERCERYDOC.close;
Qry_GS_MERCERYDOC.Open;
// Qry_GS_SIZESPECDOC.ParamByName('computer_id').AsString := Qry_GS_MAKEHEAD.Fields[0].AsString;
// Qry_GS_SIZESPECDOC.close;
// Qry_GS_SIZESPECDOC.Open;
Qry_GS_MERCERYDOC_insert.close;
Qry_GS_SIZESPECDOC_insert.close;
InsertFlag := 0;
computer_id := '';
make_info := '';
COPYflag := 0;
end;
except
begin
GSDDATAMOD.GSDCUSTDB.Rollback;
MessageBox(Application.Handle, pchar('保存出現錯誤﹐請仔細檢查后再保存'), '錯誤', MB_OK);
end;
我的程序在按 "保存"時,有時出現"NO USER TRANSACTION IS CURRENTLY IN PROGRESS "
這個提示,我不知道問題出在哪里,希望能給我一點提示!
我的原代碼如下:
if GSDDATAMOD.GSDCUSTDB.InTransaction = true then
GSDDATAMOD.GSDCUSTDB.RollBack;
GSDDATAMOD.GSDCUSTDB.StartTransaction;
Qry_GS_MAKEHEAD.ApplyUpdates;
arraytoqry(Qry_GS_COLOR_CODEDOC_insert, Qry_GS_MAKEHEAD);(這個函數是表Qry_GS_MAKEHEAD 里插入數據)
Qry_GS_COLOR_CODEDOC_insert.ApplyUpdates;
Qry_GS_MERCERYDOC_insert.ApplyUpdates;
// Qry_GS_SIZESPECDOC_insert.ApplyUpdates;
GSDDATAMOD.GSDCUSTDB.Commit;
Qry_GS_COLOR_CODEDOC_insert.CommitUpdates;
Qry_GS_MERCERYDOC_insert.CommitUpdates;
Qry_GS_COLOR_CODEDOC.ParamByName('computer_id').AsString := Qry_GS_MAKEHEAD.FieldBYNAME('COMPUTER_ID').AsString;
Qry_GS_COLOR_CODEDOC.close;
Qry_GS_COLOR_CODEDOC.Open;
Qry_GS_MERCERYDOC.ParamByName('computer_id').AsString := Qry_GS_MAKEHEAD.FieldBYNAME('COMPUTER_ID').AsString;
Qry_GS_MERCERYDOC.close;
Qry_GS_MERCERYDOC.Open;
// Qry_GS_SIZESPECDOC.ParamByName('computer_id').AsString := Qry_GS_MAKEHEAD.Fields[0].AsString;
// Qry_GS_SIZESPECDOC.close;
// Qry_GS_SIZESPECDOC.Open;
Qry_GS_MERCERYDOC_insert.close;
Qry_GS_SIZESPECDOC_insert.close;
InsertFlag := 0;
computer_id := '';
make_info := '';
COPYflag := 0;
end;
except
begin
GSDDATAMOD.GSDCUSTDB.Rollback;
MessageBox(Application.Handle, pchar('保存出現錯誤﹐請仔細檢查后再保存'), '錯誤', MB_OK);
end;