Home How to display progress of the TFDScript execution using TProgressBar?
Reply: 0

How to display progress of the TFDScript execution using TProgressBar?

user955
1#
user955 Published in May 25, 2018, 9:05 am

I have some script in some file "MyScript.sql" On the form I have my TProgressBar. I want to read script with TFDScript and move progressbar according to the script.

My code is

    Var

      Lista: TStringList; // SQL DDL list for creating table and populate table
      I: Integer;
    Begin

  With FDConn Do    //FDConn is my FaireDac connection
  Begin
    LoginPrompt := False;
    With Params Do
    Begin
      Clear;
      DriverID := 'SQLite';
      Database := 'MyDatabase.sdb';
      LoginPrompt := False;
    End;

    Lista := TStringList.Create;
    Lista.Clear;
    Try

      FDScript.ValidateAll;   //FDScript is TFDScript and prgBar is TProgressBar
      prgBar.Max := FDScript.TotalJobSize - 1;
      prgBar.Update;

      Lista.Clear;
      Lista.LoadFromFile('MyScript.sql');

// Now how I can read script 1 line by 1 line and move progress bar with
prgBar.StepIt;
prgBar.Update;`
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.348922 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO