Jump to content

Leaderboard


Popular Content

Showing content with the highest reputation on 11/19/22 in all areas

  1. Solid answer to those who say Delphi is dying - see how Delphi is killing 😄
  2. haentschman

    SQL problem

    SQL: Qry := TFDQuery.Create(Self); Qry.Connection := Self.AC; Qry.SQL.Text := 'select * from Documents where OriginalFileName like :PAR'; Qry.ParamByName('PAR').AsString := '%1001\%'; // with "\" Qry.Open; Qry := TFDQuery.Create(Self); Qry.Connection := Self.AC; Qry.SQL.Text := 'select * from Documents where OriginalFileName like :PAR'; Qry.ParamByName('PAR').AsString := '%1001%'; // without "\" Qry.Open; ...it works...i not like guessing.
  3. haentschman

    SQL problem

    ...no. FDQuery1.SQL.Text := 'select * from tab where code LIKE :Code'; FDQuery1.ParamByName('code').AsString := '%123%'; FDQuery1.Open; ...the "%" is in the parameter! Other Example: Qry.ParamByName('REN').AsString := '%[_]' + Pair.Key + '[_]' + Pair.Value + '%';
  4. haentschman

    SQL problem

    by the way... FDQuery1.SQL.add('WHERE (MainDirectory LIKE ''%' + Edit1.Text + '%'') OR INSTR(''' + Edit1.Text + ''', MainDirectory) > 0' ); you know what SQL Injection is? https://en.wikipedia.org/wiki/SQL_injection The german site is better... With delphi examples: https://de.wikipedia.org/wiki/SQL-Injection 🙄 Always use parameters!
  5. miab

    Can you mix VCL and FMX?

    You can use firemonkey-container
  6. I know right? I'm like that too when it comes to Delphi, LOL. Usually when I'm using C# or Angular, creating classes are so easy, you can write one up so quickly that you don't have to think about it. In Delphi it's a whole lot more verbose, and annoying, so I try and avoid it and end up working around it. That's just my opinion anyway.
  7. Pat Foley

    how would you do this? Pass API params from UI into API unit

    /*----In EventModule---*/ Edits: Tlist<TtextPair>; // business logic here /*----elsewhere in UI realm--*/ EB.Edits.add(TtextPair.create(uf.Edit2,uf.lbleditErrors)); //uf ~ TForm //source Remu Lebeau response https://stackoverflow.com/questions/64145742/cannot-change-tedit-text-in-delphi. TtextPair = Tpair<TComponent, TComponent>; //edit Timer scans the cached edits length and does stuff. OT I been running some JS thanks for those posts on TMS and TypeScript.
  8. This is probably the best example I've seen on proper use of the parallel libs and how to keep the UI responsive and updated (on multiple platforms). It doesn't cover all the corners of the parallel lib - but it is an excellent example of how beautifully simple multithreading can be.
×