-
Content Count
213 -
Joined
-
Last visited
-
Days Won
5
Everything posted by haentschman
-
...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 + '%';
-
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!
-
How to 'disconnect' a TFDQuery keeping the datas.
haentschman replied to PhilPlus's topic in Databases
Hi... That's why the components are called "data sensitive". Without a direct connection to the database you have no data.... (unless there is something new ) You have to come up with a separation of data and database. Variant 1: 1. load data with query 2. transfer the data into objects 3. throw away query 4. change data in object 5. save object with SQL (create query, throw away query) ... with this variant one gets along also without data-sensitive components. You can then display an object in the grid as well as a property in the edit. Variant 2: Copy to another dataset: https://docwiki.embarcadero.com/Libraries/Sydney/en/FireDAC.Comp.DataSet.TFDDataSet.CopyDataSet Imho there are other variants.... -
Hi... https://componentace.com/zipforge_features.htm I use it to make zip of a MSSQL database backup. All others stop at 2GB. 6GB -> 1GB For Single Developer with Source Code $149
-
ExtractFilePath v TDirectory.GetCurrentDirectory
haentschman replied to Ian Branch's topic in General Help
Hi... https://docwiki.embarcadero.com/Libraries/Seattle/en/System.IOUtils.TDirectory.GetCurrentDirectory Current working directory: 99% <> ExtractFilePath(Application.ExeName) Example: Current working directory can be "C:\Windows\System32" or else a special folder... -
...learning by doing. π You can also adapt the example to your circumstances. Release of the stream. etc.
-
...see editing ...is my case. Sometimes i read the Picture to a new object (Picture = nil)
-
Hi...π try this...π if not Qry.FieldByName('Picture').IsNull then begin Stream := TMemoryStream(Qry.CreateBlobStream(Qry.FieldByName('Picture'), bmRead)); try Contact.Picture := TMemoryStream.Create; Contact.Picture.LoadFromStream(Stream); finally Stream.Free; end; end; before...Contact.Picture = nil π
-
Hi... ...this is right. π ...but the language has also changed. "with" is 90's. The "new" TRect was imho the first problem in this case. The structure of TRect was changed. Some "with" had the false scope...AccessViolation. The biggest problem with "with" is: with TTaskDialog.Create(Self) do try Title := 'Warning!'; Text := GetTextFromFunction; CommonButtons := [tcbOk]; Execute; finally Free; end; ...and now you set a breakpoint on "Excecute". Then read the variable content from "Text" under the mouse...you see nothing. More Info ( June 26, 2007 ) https://blog.marcocantu.com/blog/with_harmful.html
-
In the modern Delphi...always NO. see uses TRect - https://stackoverflow.com/questions/71419/why-should-i-not-use-with-in-delphi ...and other. procedure MainForm.ButtonClick(Sender: Object) begin with TMyForm.Create(nil) do try ShowModal; finally Free; end; ...this means a rebuild of the code if complexity increases...why not "right" with instance variable. ...and the variable display in the debugger does not work. I am out of this discussion...
-
Clear... I have only TForm1 always renamed to foBlubb etc.
-
wuppdi Welcome Page for Delphi 11 Alexandria?
haentschman replied to PeterPanettone's topic in Delphi IDE and APIs
Hi... @gkobler: ...thanks But...for the community: please without advertising (link) in the header ...then i install tis to. -
Hi...π 1. multiuser? 2. server?...other maschine? 3. persistent data? ...or daily? 4. program crash? ...which data?
-
Hi...π Show the connection string...
-
Code completion not supplying variable names
haentschman replied to Tom F's topic in Delphi IDE and APIs
Hi... ...bevore LSP yes. With SLP (D11) not so good. Sometimes Ok, sometimes fail...π PS: i am a fan of this code completion π ...but so not. π -
Hi... ...always try/finally! In case of error IdHTTP.free is not executed because skipped to the end Better: IdHTTP := TIdHTTP.Create(nil); try try S := IdHTTP.Get(Link); result := S; except ShowMessage('Could not get VERSION information'); end; finally IdHTTP.Free; end;
-
TidHTTP [SSL], SSL errors is production, not in developement
haentschman replied to mvanrijnen's topic in Network, Cloud and Web
i had problems with this...Windows Defenderο»Ώ is imho good and enough... ...but now back to the topic. -
TidHTTP [SSL], SSL errors is production, not in developement
haentschman replied to mvanrijnen's topic in Network, Cloud and Web
...why? π€’ (only my opinion) -
TidHTTP [SSL], SSL errors is production, not in developement
haentschman replied to mvanrijnen's topic in Network, Cloud and Web
Hi... ...location of the dll? -
MessageDlg, mtConfirmation Wrong After Delphi 10.4
haentschman replied to stacker_liew's topic in VCL
Hi...π How about using a own TForm as a MessageDlg? ...own design, formatted texts (TStringlist etc.), own icons? π -
Hi... NOT with WITH: with TFDQuery.Create(self) do
-
Hi... ...+1
-
What is good replacement for FastReports?
haentschman replied to GreatDayDan's topic in General Help
...nothing. π Why you want to change? -
Hi...π ...not query?