M
microming
Unregistered / Unconfirmed
GUEST, unregistred user!
DELPHI中帮助如下,可就是对单个DATABASE进行操作,但我现在的数据库是在两个不同的
DATABASE中,(不并在一个DATABASE中),如何才能同时进行保存,错误后又可同时返回
with CustomerQuery do
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;
DATABASE中,(不并在一个DATABASE中),如何才能同时进行保存,错误后又可同时返回
with CustomerQuery do
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;