Jump to content

Serge_G

Members
  • Content Count

    311
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by Serge_G

  1. Serge_G

    New Firebird 4 datatype "TIMESTAMP WITH TIMEZONE"

    @Dmitry Arefiev My tests was with Delphi 12 first. Some links or clues ? Agree, even if I rarely use FDTable 😉
  2. Serge_G

    New Firebird 4 datatype "TIMESTAMP WITH TIMEZONE"

    Testing D12, I made small tests. First using 2 versions of Firebird (3 and 4) I made a mistake not using a TFDPhysFBDriver, default connection was using fb3 this mistake stop IDE ! FDPhysFBDriver settled I now run in another error with my French edition working with SQL To search : using FormatOptions (of the FDConnection.FDQuery or FDTable) using mappings
  3. Serge_G

    Copy table data between two different databases.

    Perhaps me 😊 if so, in my mind it was like this, source is Database A, dest is Database B Source selection is a TFDQuery so you can restrict to what you need, this to respond your "truncating data" you just have to adjust properties of FDBatchMove, depending on process you want (only appending, appending or updating see property mode) Note : keep in mind what you have to do with errors during the process. 3300 records is not so much. to be known, fdbatchmove have a contextual menu. The 3 first options are very useful and with the first one ( Execute) debugging is easy (without running program !) see https://docwiki.embarcadero.com/Libraries/Alexandria/en/FireDAC.Comp.BatchMove.TFDBatchMove and https://docwiki.embarcadero.com/CodeExamples/Alexandria/en/FireDAC.TFDBatchMove_Sample
  4. To react to this, here is the structure I used
  5. First declare fields Then set event on GetText for the field and code the event procedure TForm1.FDTable1Date_exitGetText(Sender: TField; var Text: string; DisplayText: Boolean); begin if Sender.IsNull then text:='n.d.' else Text:=FormatDateTime('mm-dd-yyyy',UnixToDateTime(Sender.Value)); end; on design date_exit should be an integer but at run time "magic" happens Now let speak about another method for Timestamp type (my date_create) You just have to set property displayformat to get the date_create formatted at runtime but also at design time (yellow)
  6. Serge_G

    Button with changing image

    Easy way changing imageindex, but need a ImageList or equivalent. Personally, most often, I use SVG directly or loaded in resource You can also change, add/change buttonstyle and applystylelookup
  7. Serge_G

    FMX custom control development

    Gagné, mon site https://serge-girard.developpez.com/ mon blog https://www.developpez.net/forums/blogs/138527-sergiomaster/
  8. Serge_G

    FMX custom control development

    Une autre petite piste dans ce blog, étudier les sources du dépot git indiqué n'est pas une mauvaise idée. Idem, j'ai pas mal déblatéré dans ce forum As I don't know if this forum is not an English only forum : Another little tip in this blog, studying the sources of the indicated git repository is not a bad idea. Ditto, I've rambled quite a bit in this forum
  9. Serge_G

    FMX custom control development

    I wrote some tutorials in french (3 part but only 2 published) you can find here Part1 Part2 last part (a RadioCombobox) still in progress
  10. Serge_G

    Rounded corners in Firemonkey TListView Item

    One solution is to use DynamicAppearance and add an image. I explained this (in french) here and there The only job to add is to rework the bitmap to have RoundedCorners in this part procedure TForm1.ListView1UpdatingObjects(const Sender: TObject; const AItem: TListViewItem; var AHandled: Boolean); var AListItemBitmap : TListItemImage; AListItemText : TListItemText; AColor : TAlphaColor; begin AListItemBitmap:=AItem.Objects.FindObjectT<TListItemImage>('Image2'); AListItemText:=AItem.Objects.FindObjectT<TListItemText>('Text1'); if assigned(AListItemBitmap) then begin AListItemBitmap.Bitmap:=TBitmap.Create(40,40); try AColor:=StringToAlphaColor(AListItemText.Text) except AColor:=TAlphaColorRec.Null; end; AListItemBitmap.Bitmap.Clear(AColor); end; end; Still some work to do but a first result
  11. Serge_G

    Lock FDTable

    You don't gave us the SGBD used. Code can be reduced, without an FDQuery using FDConnection var x:=FDConnection1.ExecSQLScalar('SELECT 1 FROM WeighingCows WHERE Cownumber = :C', Drivers.DBEdit1.Text); if varisnull(x) then begin MessageDlg('This number exist', mtError, [mbOK], 0); FDTable1.Cancel;<<<<<<<<<<< if execute then OK end;
  12. Serge_G

    Problem with fdquery when checking active

    For me it's the FDConnection that was active. When you activate the Query, the FdConnection was enabled also I always change the ConnectedStoredUsage properties of FDConnection to false to avoid this problem.
  13. Serge_G

    Mouse events not triggered, caused by styled TMainMenu?

    I have no response to that, all my "pro" FMX applications (using at least 2 styles) are D10.3 with few chance to update to newer versions. Retiring at the end of the year, I don't think I should face the problem
  14. Serge_G

    Mouse events not triggered, caused by styled TMainMenu?

    Sorry for that, I saw that form2 was created once. I am not adept of that, preferring a modalform.Create and modalform.release in my apps Yes, but it's a lot perturbing for me To answer this usage of old style usage retrieve my mind's ticket is here (Patrick Premartin is the reporter because I was lazy to do it ) french discussion here @XylemFlow procedure TForm1.CheckBox1Change(Sender: TObject); begin if CheckBox1.IsChecked then StyleBook:=StyleBookDark else Stylebook:=StyleBookLight; UpdateStyleBook; end; procedure TForm1.MenuItem4Click(Sender: TObject); begin // Apply current style to modalform Form2.StyleBook:=Stylebook; Form2.Showmodal end; tested with polardark_win and polarlight_win styles
  15. Serge_G

    Mouse events not triggered, caused by styled TMainMenu?

    Hi, I think there are more than one coding errors 🙄 i.e. ChildForm is not released, StyleBookLight don't contain data .... I worked a similar project last year, you can find here I had some similar problem using an old 10.2 style (don't remember circumstance)
  16. But why did you use ODBC when you can use the Firedac Driver ?
  17. Yes that was what I suggest more or less Not so, but database structure is not very pro.
  18. Is FB not too much for a program that seems to be mono-user and with a screenshot more Android (so Firebird is not easy to install ) than windows OS
  19. For me, you complicate your life If you use livebindings and synchronize your datasource to the listview you don't have to add a query. I made some tests. Not so evident, I think the best way is to create a new method for livebindings (I explore this in this tutorial). For now, I just use a database (Firebird one) trick to get linebreak value and use CustomFormat:=%s+dataset.BR.text+dataset.stringrediants1.value+dataset.BR.text+dataset.stringrediants2.value+ ... Can you attach your database and I will write a quick program as demo ? Attached a quick sample Ok, I don't create UI to add some coktails, just respond to first question "show only the records based on the item i click in a listbox." (listview) Cocktails.zip
  20. My desktop FMX apps are 32/64 bits windows and Linux, my firebirds install are 64 bits (default FB3 on port 3050, FB4 on 3054) And I don't have any problem with that. Even if I can also read server FB Database on Android, I tried to have full a Firebird embedded on Android without success. This code is extracted from a procedure in my Datamodule Yes No
  21. Hum, now I am looking the table structure IMHO the database structure is not a valid one. I think about a : Beverage table, Ingredient table, and Composition table instead of the "monolithic" table you seem to use (according livebinding screenshot
  22. Well, you can write all LiveBindings at runtime also 😉. I agree Visual LiveBindings is not a perfect tool 😲
  23. 1) Drop a FDConnection and set properties first one should be FBDriver short response long response eventually, you can change connection properties at runtime . As sample here what I use to connect my database With ConnexionBase.Params as TFDPhysFBConnectionDefParams do begin UserName:=parametres.utilisateur; Password:=parametres.motdepasse; Server:=IP; // Ip addresse Database:=Parametres.nombase; SQLDialect:=3; end; try ConnexionBase.Connected:=True; result:=true; except result:=false; end; 2) Don't use " " except if you need case-sensitive column names. Avoid * in your SQL. (If you use Flamerobin it's easy to generate SQL text) your SQL should be SELECT Index2,French,FrenchUTF,FrenchMod,English,Latin,Greek,Spanish,German,Chinese,Arabic,Russian,Italian,Pasigraphie,PasiImage,Notes FROM dictionary WHERE Index2 = :INDEX2 Note if you have this FDQuery you can code this FDQuery1.open('',[valueof parameter]); instead of FDQUery1.Close; // no need to change SQL Text every time FDquery1.ParamByName('Index2').asInteger:=xxx // value of parameter fdquery1.Open; A tip : set FdConnection.ConnectedStrorageUsage.auRuntime to false
  24. Hi, First, all my tutorials are Here For your need, you can use CustomFormat property of the link (should something like %s+' '+dataset.stringrediants1.value+....) I never test newline constant in an expression 🙄 something I should test soon 😄 I'm curious. but I suggest you to treat the problem at the datasource and concatenate the fields in your query (advantage 1 - readonly field, advantage 2 - speed)
×