请看下面的 代码:
fData.dbProperty.StartTransaction;
try
qCommit.ExecSQL;
fData.dbProperty.Commit;
except
fData.dbProperty.Rollback;
Application.MessageBox('连接数据库失败,请与系统管理员联系!','提示',0+64);
end;
明明已经start了事务,为什么报这种错误:
no user transaction is currently in progress.
rollback transaction没有对应的begin transaction?
fData.dbProperty.StartTransaction;
try
qCommit.ExecSQL;
fData.dbProperty.Commit;
except
fData.dbProperty.Rollback;
Application.MessageBox('连接数据库失败,请与系统管理员联系!','提示',0+64);
end;
明明已经start了事务,为什么报这种错误:
no user transaction is currently in progress.
rollback transaction没有对应的begin transaction?
begin
Database1.StartTransaction;
try
ApplyUpdates; {try to write the updates to the database};
Database1.Commit; {on success, commit the changes};
except
Database1.Rollback; {on failure, undo the changes};
raise; {raise the exception to prevent a call to CommitUpdates!}
end;
CommitUpdates; {on success, clear the cache}
end;
是insert 触发器的原因导致的问题。
我的语句没有问题。呵呵!