To saoren:
我在程序中(DataSetProvider的BeforeUpdateRecord事件中)加了你所说的
CoInitialize(nil);
try
Case UpdateKind of
ukInsert:
begin
//DoInsert;
if SourceDS.Tag=1 then
begin
do
TableInsertSQl(DeltaDS,'posItem');
end else
begin
DeltaDS.FieldByName('DID').NewValue:=NewGetMaxRecordDIDValue('33',DeltaDS.FieldByName('DID').AsString);
InputVar:=VarArrayCreate([0,4], varVariant);
InputVar[0]:='0';
InputVar[1]:=DeltaDs.FieldByName('Writer').AsString;
InputVar[2]:=DeltaDs.FieldByName('Type').AsString;
InputVar[3]:=DeltaDs.FieldByName('Sum_').AsString;
InputVar[4]:=0;
do
ClientEvent(InputVar);
do
TableInsertSQl(DeltaDS,'posMast');
end;
end;
ukDelete:
begin
do
Delete;
end;
end;
Applied:=True;
finally
Couninitialize;
end;
一样会提示“无法在此会话中启动更多的事物”, 是什么原因呢?