N
netyu
Unregistered / Unconfirmed
GUEST, unregistred user!
web service里的方法:
procedure TDistributionSrv.UpdateDataByORD(const pDspName1: WideString;
pDelta1: OleVariant;
const pDspName2: WideString;
pDelta2: OleVariant;
const pDspName3: WideString;
pDelta3: OleVariant;
const pAccount: WideString;
var pError: SYSINT);
var
obj: IAgent;
begin
CoInitialize(nil);
obj := CoAgent.Create;
try
obj.UpdateORD(pDspName1, pDelta1, pDspName2, pDelta2,
pDspName3, pDelta3, pAccount, pError);
finally
obj := nil;
CoUninitialize;
end;
end;
Com+里的方法:
procedure TDistribution.UpdateORD(const pDspName1: WideString;
pDelta1: OleVariant;
const pDspName2: WideString;
pDelta2: OleVariant;
const pDspName3: WideString;
pDelta3: OleVariant;
const pAccount: WideString;
var pError: SYSINT);
var
AgentObj: IAgent_Module;
AgentAps: IAppServer;
Options: TGetRecordOptions;
OwnerData: OleVariant;
ErrorCount: integer;
TransactionContextEx: ITransactionContextEx;
begin
TransactionContextEx := CreateTransactionContextEx;
pError := 0;
try
OleCheck ( TransactionContextEx.CreateInstance(CLASS_Agent_Module , IID_IAgent_Module, AgentObj));
AgentAps := AgentObj as IAppServer ;
Options := [grMetaData, grReset];
if not VarIsNull(pDelta1) then
begin
AgentAps.AS_ApplyUpdates(pDspName1, pDelta1, pError, ErrorCount, OwnerData);
end;
if not VarIsNull(pDelta2) then
begin
AgentAps.AS_ApplyUpdates(pDspName2, pDelta2, pError, ErrorCount, OwnerData);
end;
if not VarIsNull(pDelta3) then
begin
AgentAps.AS_ApplyUpdates(pDspName3, pDelta3, pError, ErrorCount, OwnerData);
end;
TransactionContextEx.Commit;
pError := ErrorCount;
except
TransactionContextEx.Abort;
pError := ErrorCount;
end;
end;
客户端数据保存成功后,出现Invalid variant type出错问题,但数据库里已保存数据
是什么原因引起的????????????
procedure TDistributionSrv.UpdateDataByORD(const pDspName1: WideString;
pDelta1: OleVariant;
const pDspName2: WideString;
pDelta2: OleVariant;
const pDspName3: WideString;
pDelta3: OleVariant;
const pAccount: WideString;
var pError: SYSINT);
var
obj: IAgent;
begin
CoInitialize(nil);
obj := CoAgent.Create;
try
obj.UpdateORD(pDspName1, pDelta1, pDspName2, pDelta2,
pDspName3, pDelta3, pAccount, pError);
finally
obj := nil;
CoUninitialize;
end;
end;
Com+里的方法:
procedure TDistribution.UpdateORD(const pDspName1: WideString;
pDelta1: OleVariant;
const pDspName2: WideString;
pDelta2: OleVariant;
const pDspName3: WideString;
pDelta3: OleVariant;
const pAccount: WideString;
var pError: SYSINT);
var
AgentObj: IAgent_Module;
AgentAps: IAppServer;
Options: TGetRecordOptions;
OwnerData: OleVariant;
ErrorCount: integer;
TransactionContextEx: ITransactionContextEx;
begin
TransactionContextEx := CreateTransactionContextEx;
pError := 0;
try
OleCheck ( TransactionContextEx.CreateInstance(CLASS_Agent_Module , IID_IAgent_Module, AgentObj));
AgentAps := AgentObj as IAppServer ;
Options := [grMetaData, grReset];
if not VarIsNull(pDelta1) then
begin
AgentAps.AS_ApplyUpdates(pDspName1, pDelta1, pError, ErrorCount, OwnerData);
end;
if not VarIsNull(pDelta2) then
begin
AgentAps.AS_ApplyUpdates(pDspName2, pDelta2, pError, ErrorCount, OwnerData);
end;
if not VarIsNull(pDelta3) then
begin
AgentAps.AS_ApplyUpdates(pDspName3, pDelta3, pError, ErrorCount, OwnerData);
end;
TransactionContextEx.Commit;
pError := ErrorCount;
except
TransactionContextEx.Abort;
pError := ErrorCount;
end;
end;
客户端数据保存成功后,出现Invalid variant type出错问题,但数据库里已保存数据
是什么原因引起的????????????