Skip to content

TAnonymousThread.Execute_Sync question.. #134

Description

@ijbranch

D12.2, 32 bit App.
I have implemented this code:

TAnonymousThread.Execute_Sync(procedure
      begin
        try
          //
          var dtStart: TDateTime := Now;
          //
          DBSBackup.Execute('BACKUP DATABASE "DBiArchive" AS "DBiArchive Manual Backup - ' + FormatDateTime('yyyy-mm-dd @ HHnn',
            now) + '" TO STORE "Backups" COMPRESSION 9 INCLUDE CATALOG');
          //
          BackupsLog.Open;
          BackupsLog.AppendRecord([dtStart, now, 'DBiArchive', 'Manual', AUD.UserID, now]);
          BackupsLog.Close;
          //
        except
          // Handle any exceptions that might occur during the execution of the SQL code
          on E: Exception do ShowMessage('Error performing database backup: ' + E.Message);
          //
        end;
      end
      )
      .Start;

I interpreted Execute_Sync would allow me to move the Form while the thread executed.
It would seem not.
How to be able to please?

Regards & TIA,Ian

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions