Subject Re: [IBO] Multiple instansiation of a TdataModulw with IBO
Author nibler@t-online.de
Hi,

> is it allowed practice to instanciate more than once the same
> TdataModule containing IBO components (TIB_connection,
> TIB_transaction, TIBOQuery)?

Yes, I never had any problems with it.
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