-
Content Count
315 -
Joined
-
Last visited
-
Days Won
1
Everything posted by Serge_G
-
How to open Firebird 3 Database in FireDAC Delphi 11 (64Bit)
Serge_G replied to Blavatsky's topic in Databases
I am not a Refresh fan -
get idDrink out of database , based on what is clicked in listbox
Serge_G replied to grantful's topic in Databases
Well, you can write all LiveBindings at runtime also 😉. I agree Visual LiveBindings is not a perfect tool 😲 -
How to open Firebird 3 Database in FireDAC Delphi 11 (64Bit)
Serge_G replied to Blavatsky's topic in Databases
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 -
get idDrink out of database , based on what is clicked in listbox
Serge_G replied to grantful's topic in Databases
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) -
get idDrink out of database , based on what is clicked in listbox
Serge_G replied to grantful's topic in Databases
First question : Is this supposed to be a FMX or a VCL program ? If FMX you can write this app with "no code" (except itemclick to change from list to view and reverse) using Livebindings Here a french tuturial I wrote (2018) -
Yes, you have to change port in firebird conf for one of your Firebird version Here my w10 workstation with default FB3 and FB4 possibility. Very easy with FDBatchmove, but take care of the capacities of Firebird and optimize your table structure
-
No, no demo project, it's very easy to reproduce with only the picture as guideline. The connections and query parameters are too depending of your needs
-
[Android] How to put data from a dataset into a listbox?
Serge_G replied to Fabian1648's topic in FMX
Why don't you use a TListView with dynamic appearance and Livebindings ? -
Hi, The simplest way (without checking errors) procedure loadbitmapfromblob(abitmap : TBitmap; aBlob : TField); var aStream : TMemoryStream; begin aStream:=TMemoryStream.Create; try TBlobField(aBlob).SaveToStream(aStream); // aStream.Position:=0; aBitmap.LoadFromStream(aStream); finally aStream.Free; end; end; usage loadbitmapfromblob(Image1.Bitmap,datamodule2.InsertImg.FieldByName('camarapic')); But can I suggest this ? (FMX program) or even using Livebindings for "no code" procedure loadImagefromblob(aImage: TImage; aBlob: TField); begin var aStream: TMemoryStream; begin if aBlob.IsNull then aImage.Visible := False else begin aStream := TMemoryStream.Create; try TBlobField(aBlob).SaveToStream(aStream); try aImage.Bitmap.LoadFromStream(aStream); aImage.Visible:=true; except aImage.Visible := False; end; finally aStream.Free; end; end; end; end; for VCL use this procedure, not forgetting to declare units Vcl.Imaging.jpeg and Vcl.Imaging.pngimage procedure TFormVCL.loadImage(aImage: Timage; aField: TField); var aStream : TmemoryStream; begin if aField.IsNull then aImage.Visible:=false else begin aStream:=TmemoryStream.Create; try TBlobField(aField).SaveToStream(aStream); aStream.Position:=0; AImage.Picture.LoadFromStream(aStream); aImage.Visible:=true; finally aStream.Free; end; end; end;
-
Sorry, I found file fishfacts.cds in <RadStudioDemos-Main> \Object Pascal\LiveBindings\common demo found here on GitHub
-
It's Livebindings. On your form you certainly have a TClientDataset (database name is now C:\Users\Public\Documents\Embarcadero\Studio\21.0\Samples\Data\biolife.cds) a TBindingList and a TBindSourceDB
-
Il existe un très bon forum en français https://www.developpez.net/forums/f15/environnements-developpement/delphi/ (mon pseudo SergioMaster)
-
Hi, perhaps TMSFNCGrid
-
👍 programmerd2k response, and, with firedac, you can simplify his code to : procedure TForm1.Button1Click(Sender : TObject) begin Salestable.open('',[DateFrom.Date,Dateto.Date]); end;
-
To respond to question point 8. There are one style for each platform because doing this you reduce size of the app. In your case, my usage is to create one data module per platform and using IFDEF$ clause on each data module a Stylebook corresponding to platform, all the Stylebook have UseStylemanager=true.
-
I was thinking this way, even if I don't know it could solve your problem
-
Using Charset NONE is a regrettable habit ! I still have some database with this default encoding and migration to best encoding is not so easy, no easy tool for this ! Try to use WIN1252 as fdconnexion charset
-
You need 32bit version for the IDE
-
logiciel de gestion commercial avec code a barre en delphi
Serge_G replied to krimo's topic in Databases
Il ne faut pas rêver, j'ai bien sûr conçu un logiciel de ce genre (magasin usine d'un fabricant de chaussures), mais, fournir les sources sans rémunération, comment je me paye la maintenance de Delphi ?- 4 replies
-
- logiciel;code a barre
- ;gestion;stock
-
(and 3 more)
Tagged with:
-
ExtendedMetadata and .AsInteger for small int column
Serge_G replied to TurboMagic's topic in Databases
Since FB.3 boolean type exists https://firebirdsql.org/file/documentation/chunk/en/refdocs/fblangref30/fblangref30-datatypes-booleantypes.html -
Ah, ok, in this case TListBox (or a <Vert,Horz>ScrollBox with Frames) is the need. When XE4, ListView and dynamic appearance does not exist, as neophyte to styles I wrote my experience in this paper. I think this chapter will cover your needs
-
Don't you think you can use FMX.Tlistview (dynamic appearance) instead of FMX.Tlistbox ? I wrote many (french) notes here or tutorials (here) about
-
Sure, you can't catch the error if the error is in the upper code ! I think you use a wrong way. As I understand you have a FDQuery so one way is to use edit/post/delete and so on is to link it to a FDUpdateSQL (fill clauses with expert or by hand) with this method, you can use a "classic" qry.Insert; // or qry.append qry.FieldByName('col1').asString:='some string'; qry.fieldbyname('col2').as ... qry.post In a livebinded grid nothing to code Some remarks : - when you open a query (or a table) the connection is connected automatically - use your commands SQL directly on the connection and parameters con.ExecSQL('insert into tblBarcodes values (:i, :p1,:p2,:p3,:p4)', [6,'120422','Q','abc1','2 120422 Q abc1 desc1']); - use the INSERT INTO TABLE (<list of column>) VALUES (<list of values>) to avoid auto increment columns - except if you want a "physical" ordered table don't worry about APPEND
-
I don't think this is a good one solution. You say it's a FMX project and I assume : - you use livebindings - con is your fdconnection You can do your delete via the FDConnection like this procedure TForm1.btnDelLastRowClick(Sender: TObject); var lastrowid : integer; begin Query1.last; lastrowid:=Query1.Fieldbyname('IDNO').asInteger; if lastrowid.isnull then exit; // if table is empty con.ExecSQL('delete from tblBarcodes where IDNo=:s',[lastRowValue]); query1.Open(); // or Query1.open('Select * from tblbarcodes'); end; now this code should show some flickering and have disadvantage to unselect the current row selected 😞 because of Query1.open 1- flickering can be avoided by BeginUpdate .. EndUpdate block 2- there are many ways to memorize current position in the dataset - using key, memorize in another variable the current idno and using var currentid : integer :=Query1.FieldbyName('IDNO').asInteger; // code for deleting Query1.Open(); Query1.Locate('IDNO',currentid,[]); not recommended if not mono user app - using recordno - using FDQuery.GetBookmark and FDQuery.GotoBookmark
-
Perhaps this one https://www.trichview.com/ showed in getIt ?