Subject | Re: [IBO] Multiple instansiation of a TdataModulw with IBO |
---|---|
Author | nibler@t-online.de |
Post date | 2003-05-30T10:43:35Z |
Hi,
Just make shure to set the name of the datamodule.
procedure TdmMultiInstance.DataModuleCreate(Sender: TObject);
begin
Name := '';
end;
procedure TdmMultiInstance.DataModuleDestroy(Sender: TObject);
var i,cnt:integer;
begin
cnt := ComponentCount-1;
for i := 0 to cnt do if Components[i].InheritsFrom(TIB_Dataset) then
with (Components[i] As TIB_Dataset) do begin
if assigned(IB_Transaction) then begin
IB_Transaction.CloseWithConfirm;
end;
if Active then begin
Close;
end;
if Prepared then begin
UnPrepare;
end;
end;
end; {DataModuleDestroy}
Harald
> is it allowed practice to instanciate more than once the sameYes, I never had any problems with it.
> TdataModule containing IBO components (TIB_connection,
> TIB_transaction, TIBOQuery)?
Just make shure to set the name of the datamodule.
procedure TdmMultiInstance.DataModuleCreate(Sender: TObject);
begin
Name := '';
end;
procedure TdmMultiInstance.DataModuleDestroy(Sender: TObject);
var i,cnt:integer;
begin
cnt := ComponentCount-1;
for i := 0 to cnt do if Components[i].InheritsFrom(TIB_Dataset) then
with (Components[i] As TIB_Dataset) do begin
if assigned(IB_Transaction) then begin
IB_Transaction.CloseWithConfirm;
end;
if Active then begin
Close;
end;
if Prepared then begin
UnPrepare;
end;
end;
end; {DataModuleDestroy}
Harald