前题:
现在有一个项目,一台远程的服务器,对应多个点的客户端,故此采用了先从服务器端取数到客户端,再进行操作的方式。(RemObjects)
问题:
当客户端操作完将资料更新回服务器后,客户端必需再取数一次,否则下次操作记录更新时就会发生错误。
求助:
是否有更好的方法可以令客户端每操作一次更新后,不需求重新取数而不影响下次数据的操作与更新?
现在有一个项目,一台远程的服务器,对应多个点的客户端,故此采用了先从服务器端取数到客户端,再进行操作的方式。(RemObjects)
问题:
当客户端操作完将资料更新回服务器后,客户端必需再取数一次,否则下次操作记录更新时就会发生错误。
求助:
是否有更好的方法可以令客户端每操作一次更新后,不需求重新取数而不影响下次数据的操作与更新?
SQLCommand: AnsiString): AnsiString;
var
Connection:_Connection;
begin
{--服务中返回数据---}
try
try
ConnectionPools.CreateInstance(Connection);
try
if Connection=nil then Raise Exception.Create('取Ado连接失败');
result := OpenXMLRecordset(Connection, SQLCommand, ['%'], TRUE);
finally
if (Connection <> nil) then ConnectionPools.ReleaseInstance(
Connection);
end;
except
on e:Exception do
begin
Raise;
end;
end;
finally
end;
end;function TChildrenService.SelectBatchUpdate(
const SQLCommand: Widestring): Boolean;
var
Connection:_Connection;
begin
{将资料更新到服务器中}
Result:=False;
try
try
ConnectionPools.CreateInstance(Connection);
try
if Connection=nil then Raise Exception.Create('取Ado连接失败');
try
Connection.BeginTrans;
DoXMLBatchUpdate(Connection,SQLCommand);
Connection.CommitTrans;
Result:=True;
except
on e:Exception do
begin
Connection.RollbackTrans;
Exit;
end;
end;
finally
if (Connection <> nil) then ConnectionPools.ReleaseInstance(
Connection);
end;
except
on e:Exception do
begin
Exit;
end;
end;
finally
end;
问题出在什么地方呢?