Jump to content

Firedac


MOGSY

Recommended Posts

type
 THelpThread = class(TThread)
 private
  FSessionName: string;
  FDataSource:  TDataSource;
  FSQL:         string;
 protected
  procedure Execute; override;
 public
  property DataSource: TDataSource Read FDataSource Write FDataSource;
  property SessionName: string Read FSessionName Write FSessionName;
  property SQL: string Read FSQL Write FSQL;
 end;
{ THelpThread }

procedure THelpThread.Execute;
var
 Session: TUniGUISession;
 MainModule: TUniMainModule;
 i: integer;
begin
 inherited;
 MakeQuery(FDataSource.DataSet as TFDQuery, FSQL, True);
 FDataSource.DataSet.Last;
 FDataSource.DataSet.First;
 Session := UniServerModule.GetSession(SessionName);
 MainModule := TUniMainModule(Session.UniApplication.UniMainModule);
 with TUniForm2(MainModule.GetFormInstance(TUniForm2)) do
   UniDBGrid1.DataSource := FDataSource
end;

This code works for me.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...