Jump to content

damos

Members
  • Content Count

    3
  • Joined

  • Last visited

Community Reputation

0 Neutral
  1. How to handle a context like (FireDac ,Unidac) with Fastreport Engine loading reports from local file or blob fields Thank you Vagelis Bekyros
  2. damos

    Database reconnection

    Hi am new Onomnithread library , and i examine the TwoFish example i understand how Working Schedule works , My question is how can i restart the FWorker.Schedule if database is not connected (for example unstable network) after a few seconds until database be connected ??? In the main thread a create an instance of TComclass procedure TMainform.Button1Click(Sender: TObject); begin acom:= TComclass.Create(nil); acom.OpenConnection(format(common.PostgresConnection,['wwwwwwwww','wwwwwwwwww','wwww']), procedure (Sender: TObject; FatalException: Exception) begin if assigned(FatalException) then Begin if FatalException is EDAerror then Begin if (FatalException as EDAerror).ErrorCode=0 then Errormessage.Caption:=FatalException.message else Errormessage.Caption:=FatalException.message+inttostr((FatalException as EDAerror).ErrorCode); End else Errormessage.Caption:=FatalException.message; // ShowMessage('Failed to connect to the database! ' + FatalException.Message) end else Begin Errormessage.Caption:='ComServer database connected' ; End; end); end; Declaration of Tcomlass procedure TComclass.OpenConnection(const databaseName: string; onConnectionOpen: TNotify); begin FWorker.Schedule( FWorker.CreateWorkItem(databaseName), FWorker.Config.OnExecute(ConnectToDatabase).OnRequestDone( procedure (const Sender: IOmniBackgroundWorker; const workItem: IOmniWorkItem) begin if assigned(onConnectionOpen) then Begin onConnectionOpen(Self, workItem.FatalException); if workItem.IsExceptional then Begin fdataModule.lisconnection.ConnectString := workItem.Data.AsString; fdataModule.lisconnection.Connected := true; end; end; end )); end; procedure TComclass.ConnectToDatabase(const workItem: IOmniWorkItem); var dataModule: TdmComdb; begin dataModule := (workItem.TaskState.AsObject as TdmComdb); dmComdblock.Acquire; //probably only necessary when using InterBase driver dataModule.lisconnection.ConnectString := workItem.Data.AsString; dataModule.lisconnection.Connected := true; try finally dmComdblock.Release; end; end;
  3. damos

    Dicom VCL Library

    Any one knows a good DICOM (Digital Imaging and Communications in Medicine) library doe Delphi.There are a few Chinese libraries but they totally missing documentation and support
×