Z
zhang w.
Unregistered / Unconfirmed
GUEST, unregistred user!
每当执行下面的摸块后(不管是1次or多次),程序在退出时都报错(如题),请指教。
delphi+ado+access 程序如下:
try
if iDataBase.InTransaction then iDataBase.CommitTrans ;
iDataBase.BeginTrans ;
with updatesql do
begin
commandtext :=toHistory1;
Parameters.ParamByName('Colv').value :=idw;
Parameters.ParamByName('date').value :=date0;
Parameters.ParamByName('jzrq').value :=date1;
execute;
commandtext :=toHistory2;
Parameters.ParamByName('dwid').value :=idw;
Parameters.ParamByName('date').value :=date0;
execute;
end;
iDataBase.CommitTrans;
except
on E: exception do
begin
iDataBase.RollbackTrans ;
MessageBox(0,pchar('保存数据错!'),pchar('TDataMain.iSavels'),
MB_OK+MB_ICONWARNING);
end;
end;
delphi+ado+access 程序如下:
try
if iDataBase.InTransaction then iDataBase.CommitTrans ;
iDataBase.BeginTrans ;
with updatesql do
begin
commandtext :=toHistory1;
Parameters.ParamByName('Colv').value :=idw;
Parameters.ParamByName('date').value :=date0;
Parameters.ParamByName('jzrq').value :=date1;
execute;
commandtext :=toHistory2;
Parameters.ParamByName('dwid').value :=idw;
Parameters.ParamByName('date').value :=date0;
execute;
end;
iDataBase.CommitTrans;
except
on E: exception do
begin
iDataBase.RollbackTrans ;
MessageBox(0,pchar('保存数据错!'),pchar('TDataMain.iSavels'),
MB_OK+MB_ICONWARNING);
end;
end;