Jump to content

haentschman

Members
  • Content Count

    217
  • Joined

  • Last visited

  • Days Won

    5

Posts posted by haentschman


  1.  

    Quote

    but "Like" can't be "parametrized".

    I dont think so...:classic_tongue:

     

    update Documents set SendTypeUSB = :GES where OriginalFileName like :PAT
    ...
    Qry := CreateQuery;
    try
      case SendType of
        sdtFolder: Qry.SQL.Text := GetSQLByName('SEAM_WRITE_SEND_FOLDER_STATE');
      end;
      Qry.ParamByName('GES').AsInteger := Integer(State);
      case ValueType of
        vatFileName:
        begin
          Qry.SQL.Add(GetSQLByName('SEAM_WRITE_SEND_WHERE_FILENAME_LIKE'));
          Qry.ParamByName('PAT').AsString := '%' + ExtractFileName(Value);
        end;

    ...it is working.

     

    Quote

    Where / how to I put the TQuery? On the Form or in the DataModule

    TQuery + TDatasource on TDataModule. :classic_cool: Never on the form! :classic_ninja:


  2. Hi... :classic_cool:

    Last week we all moved to a new server. With my new profile, among other things, the Delphi had to be reinstalled....:classic_unsure: Except for the interface from Git to Mantis "Murtle" everything is working again.

     

    Problem:
    See picture 1.
    A "Connect" via mantisconnect.php already brings this error. The config files are copied 1:1 from the old profile. The Mantis as such is
    accessible! The Mantis is not on the server but on an unchanged NAS.

     

    Can someone do something with the message?

     

    What else happened:
    * Windows update to 20H2 is still pending. Done: without success!
    * The tool is written for NET 2.0. I don't know if that was on it before... Now is from 4.5 on it.

    PS: Also with the old profile the same error comes since the change.
    PS: The aunt is silent about the murtle in connection with the error.
    PS: About the aunt I found information that may have to do with SSL3/TLS. system.io.ioexception unexpected file end
    PS: Uninstalled everything, removed settings, rebooted, installed, settings in...same error!

     

    What it should look like: Image 2

     

    Thanks for info...

     

    Addendum:
    ...imho NET 2.0 is on it. Image 3.

     

    * Crosspost in the german DP https://www.delphipraxis.net/207490-tortoisegit-mantis-murtle.html

    screen.png

    Murtle_1.png

    NET.png


  3. Hi...:classic_cool:

    Quote

    I have recently upgraded from Delphi 4 to Delphi 10.4 - yes, a big leap indeed.

    ...wow. :classic_blink:

    Quote

    so sadly now my knowledge has become obsolete.

    ...better. :classic_tongue:

     

    Questions:

    We know IBConsole and IBDatabase ...but which database you use? Firebird or Interbase?

     

    Tools:

    Admintool: https://dbeaver.io/

    ...better than console. :classic_cool:

     

    Tip:

    Never use T???Table...only T???Query and SQL!


  4. Hi...:classic_cool:

     

    ! The naming of the components with "...1" at the end seems like placing it on the form. :classic_huh:

     

    Better...

    ....
    ....
    // ! not on the form
      IdSSLIOHandlerSocketOpenSSL := TIdSSLIOHandlerSocketOpenSSL.Create(nil);
      try
        IdSMTP := TIdSMTP.Create(nil);
        try
          IdMessage := TIdMessage.Create(nil);
          try
          //
    ....
    ....
    .....
          //  
          finally
            IdSSLIOHandlerSocketOpenSSL.Free;
          end;
        finally
          IdSMTP.Free;
        end;
      finally
        IdMessage.Free;
      end;	
      //
    ...
    end;

     

    or

     

    Placing on the form... and finish. I dont like it. :classic_wacko:


  5. Hi...:classic_cool:

    Quote

    Is this construct OK?

    ...No. It contains "with". :classic_tongue: "with" is like 90s...

    Why use many developers the "with"...old school? Everybody knows by now that there can be problems with this...TRect (example) or no resolution of variables during debugging. :classic_huh:

    • Like 2

  6. TExample = class  
    private
      FIndex : Integer;
    public
      constructor Create;
      property Index: Integer read FIndex write FIndex;
    end;
    ...
    
    constructor TExample.Create;
    begin
      FIndex := 999;
    end;

    :classic_cool:

     

    ...the same idea. :classic_tongue:


  7. Hi...:classic_cool:

    Quote
    
    UPDATE FICHADAS SET HASTA = ' + QuotedStr(FormatDateTime('dd-mm-yyyy HH:nn',FDMemTbCSV.FieldByName('Fecha').AsDateTime))

    ....please use every time SQL Parameters! :classic_huh:

     

    Qry.SQL.Text := 'select Blubb from Bla where Date = :BDA';
    Qry.ParamByName('BDA').AsDateTime := Now;

    See SQL Injection:

    https://en.wikipedia.org/wiki/SQL_injection

    https://de.wikipedia.org/wiki/SQL-Injection

     

    Then you will see that the DateTime problems will disappear. (Field in DataBase = DateTime) :classic_cool:

    • Like 1

  8. Hi...:classic_cool:

    i think ist confused. :classic_happy:

     

    Please show the code of your program...

     

    Principle:

    1: loop ( while not Database.Eof do ...from Query)

    2: create Mail complete with sender, receiver (from database "FieldByName"), body (the same)  ...

    procedure Send(Sender: string; Receiver: string; Body: string);

    3: send

     

    Quote

    allinonebutton.click

    Sorry...never use a click procedure...bad design. :classic_huh:

     

    Quote

    SMTP Component not ready

    In the loop use .Open / .Close of the ICS component...imho.

×