Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


haentschman last won the day on March 23 2020

haentschman had the most liked content!

Community Reputation

61 Excellent

Technical Information

  • Delphi-Version
    Delphi 10.1 Berlin

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. haentschman

    Help Understanding SQL Parameters Utilization

    advertising This is another way to manage SQL statements. The SQL are stored in separate files in a folder structure in the project. SQL can be tested in the preferred DBMS editor.  Important: SQL Statements OUTSIDE of the Sourcecode (pas, dfm) in resources *.res. (without SQL.Add; SQL.Add; SQL.Add... )  Example: ...only 1 line for complete SQL.Text. function TDatabase.CreateDocument(Path: string): TDocument; var Qry: TFDQuery; Document: TDocument; procedure FillDocument; begin // ! Achtung Reihenfolge wegen Properties die aus Vorhergehenden ermittelt werden Document := TDocument.Create; Document.State := sdsNormal; Document.ID := Qry.FieldByName('ID').AsInteger; Document.AddDate := Qry.FieldByName('AddDate').AsDateTime; Document.AddName := Qry.FieldByName('AddName').AsString; Document.AddYear := YearOf(Document.AddDate); Document.DocumentGroupString := Qry.FieldByName('DocumentGroupString').AsString; Document.DocumentTypeString := Qry.FieldByName('DocumentTypeString').AsString; Document.DocumentCaption := Qry.FieldByName('DocumentCaption').AsString; Document.DocumentChoice := TSEAMTools.GetDocumentChoiceType(Document.DocumentTypeString); Document.SendTypeFolder := Boolean(Qry.FieldByName('SendTypeFolder').AsInteger); Document.SendTypeUSB := Boolean(Qry.FieldByName('SendTypeUSB').AsInteger); Document.SendTypeMail := Boolean(Qry.FieldByName('SendTypeMail').AsInteger); Document.ReceiptDate := Qry.FieldByName('ReceiptDate').AsDateTime; Document.ServiceDate := Qry.FieldByName('ServiceDate').AsDateTime; Document.ReceiptNumber := Qry.FieldByName('ReceiptNumber').AsString; Document.ReceiptReceiver := Qry.FieldByName('ReceiptReceiver').AsString; Document.ReceiverReceiverName := Qry.FieldByName('ReceiverReceiverName').AsString; Document.Store := Qry.FieldByName('Store').AsString; Document.StoreName := Qry.FieldByName('StoreName').AsString; Document.StoreName_1 := Qry.FieldByName('StoreName_1').AsString; Document.StoreCountry := Qry.FieldByName('StoreCountry').AsString; Document.StorePostCode := Qry.FieldByName('StorePostCode').AsString; Document.StoreLocation := Qry.FieldByName('StoreLocation').AsString; Document.StoreStreet := Qry.FieldByName('StoreStreet').AsString; Document.ServicePartner := Qry.FieldByName('ServicePartner').AsString; Document.ModifiedDate := Qry.FieldByName('ModifiedDate').AsDateTime; Document.ModifiedName := Qry.FieldByName('ModifiedName').AsString; Document.OriginalFileName := Qry.FieldByName('OriginalFileName').AsString; // als Letztes wegen Setter Document.DocumentLocation := TTools.GetDocumentLocationType(Document.OriginalFileName); Result := Document; end; begin Result := nil; Qry := CreateQuery; try // Pfad Qry.SQL.Text := GetSQLByName('SEAM_DOCUMENT_SELECT_PATH'); Qry.ParamByName('FIN').AsString := Path; Qry.Open; if Qry.Eof then begin // Belegnummer Qry.SQL.Text := GetSQLByName('SEAM_DOCUMENT_SELECT_RECEIPT_NUMBER'); Qry.ParamByName('REN').AsString := TToolsRegex.ExtractReceiptNumber(Path).Value; Qry.Open; if not Qry.Eof then begin FillDocument; end; end else begin FillDocument; end; finally Qry.Free; end; end;
  2. haentschman

    Strange message from Seattle

    Hi... ...yes! wuppdi Welcome Page
  3. TQuery + TDatasource on TDataModule. Never on the form! ...it is not an answer of your question? ...that's why i'm out.
  4. I dont think so... 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. TQuery + TDatasource on TDataModule. Never on the form!
  5. Hi... key points: 1. DBGrid -> TDataSource -> TQuery 2. SQL in Query Query.SQl.Text := 'select Bla from Bubb where Bla = :PAR' Query.ParamByName('PAR').AsString := 'Test'; Query.Open; * if you can...dont use LIKE. The database indizies are not used. * always work with parameters! See: https://en.wikipedia.org/wiki/SQL_injection ...finish.
  6. haentschman

    TortoiseGit Mantis Murtle

    Hi... Last week we all moved to a new server. With my new profile, among other things, the Delphi had to be reinstalled.... 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
  7. haentschman

    Automatic spacing of buttons on a panel??

    Hi... ...how about a TGridPanel? https://edn.embarcadero.com/article/33421
  8. haentschman

    Database in Delphi

    Hi... ...wow. ...better. Questions: We know IBConsole and IBDatabase ...but which database you use? Firebird or Interbase? Tools: Admintool: https://dbeaver.io/ ...better than console. Tip: Never use T???Table...only T???Query and SQL!
  9. haentschman

    Creating and Freeing components on-the-fly..

    Free is enough. (for components) If you have your own objects in use and you check with Assign, then FreeAndNil is correct. Otherwise Free is also enough here.
  10. haentschman

    Creating and Freeing components on-the-fly..

    Hi... ! The naming of the components with "...1" at the end seems like placing it on the form. 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.
  11. haentschman

    caFree & ,Free??

    Hi... ...No. It contains "with". "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.
  12. haentschman

    Transform string into TDateTime

    [OT] Imho is the reason the "with"... With ist like 90's. [/OT]
  13. haentschman

    Default value

    TExample = class private FIndex : Integer; public constructor Create; property Index: Integer read FIndex write FIndex; end; ... constructor TExample.Create; begin FIndex := 999; end; ...the same idea.
  14. I would like to have it in german...
  15. haentschman

    Delphi with T SQL

    Hi... The question is...why you want the imho old TSQL instead of FireDAC, UNIDAC, Zeos?