-
Content Count
311 -
Joined
-
Last visited
-
Days Won
1
Posts posted by Serge_G
-
-
2 hours ago, Jasonjac2 said:Hi Serge, thanks for replying. I didn't understand: "why is the FDPhysFBdriver is not compatible is to me largely incomprehensible" - do you mean it doesn't work at all or on certain versions of FB?
FB on android - I wasn't sure that people were doing this - which version did you use?
Ah, I was not so clear. FDPhyFBDriver is not compatible with Android and IOS. It's not a FB version problem.
I use only FBclient on Android (Firebird 4 or 3 no matter) and connect to a Fb 2.5 server (without any problem) but only with ZEOSDBO components.
Vandrovnik change some part of IBX.IBIntf.pas to access Firebird instead of Interbase (see this discussion)
3 hours ago, Jasonjac2 said:Thanks for the vote of confidence in them.
I am not so optimist I think (and really prefer Firedac)
-
8 hours ago, taariq said:If I want to use program on another pc can I just like in Access copy the DB into correct folder and use or do I need to install something ells on that pc...
Thanks for all the reply's and help...appreciate it...There are 2 ways to use Firebird :
Firebird Client/Server - You have to deploy the DB and Firebird on the other pc
Firebird Embedded - You have to put some files and directories in the same directory than applicationFor a multi user Firebird app, it's quite the same approach except you deploy only client part, with the Firebird Setup it's easy, embedded you need at least fbclient.dll and perhaps firebird.msg files in the same dir that the app.
Recommendation : Don't copy the DB file, uses backup/restore. Use a GUI Tool like Flamerobin
-
Hi
one parenthesis to delete in the first line
dmTaS.query_JobCard.SQL.Add('Insert into JobCard');
Lacking of a parenthesis after 'Values'
dmTaS.query_JobCard.SQL.Add('Values (:ID :OrderNo, :JobName)');
Consider other solutions to write SQL to be more clear, i.e.
const ISQL = 'INSERT INTO JobCard (ID ,OrderNo ,JobName) VALUES ( :ID :OrderNo, :JobName)'; // the "good" SQL for INSERT begin dmTaS.query_JobCard.Close; dmTaS.query_JobCard.SQL.Text:=ISQL; dmTaS.query_JobCard.Parameters.ParamByName('ID').Value := lb_ID.Text; dmTaS.query_JobCard.Parameters.ParamByName('OrderNo').Value := lb_OrderNo.Text; dmTaS.query_JobCard.Parameters.ParamByName('JobName').Value := lb_JobName.Text; dmtas.query_JobCard.ExecSQL; // dmTaS.query_JobCard.SQL.Clear; // unnecessary you use SQL.Text dmTaS.query_JobCard.SQL.Text := 'Select ID ,OrderNo ,JobName from JobCard'; // let's say I prefer list of columns needed rater tha a * dmTaS.query_JobCard.Open;
Under this form, it's easier to maintain IMHO
-
Hi, still in experimentation.
We have one woocommerce site, but traffic is low and interfacing (integrating orders/updating stocks) with my Delphi ERP is not a high priority.
So I only made some connection and query tests
-
On 2/13/2022 at 3:33 PM, Vandrovnik said:Hi,
I am using IBX on Windows (32 and 64bit) and Android (32 and 64bit). Database = Firebird (2.5 and 3.0). In Delphi 11, I have not found any problem.
Interesting, I certainly prefer Firedac (why is the FDPhysFBdriver is not compatible is to me largely incomprehensible) and never think to use IBX instead 😲!
I have tried other third party components to reach a Firebird DataBase like ZEOSDBO or UNIDAC, succesfully (even if deploying firebird on Androïd is really challenging the firsts times )
-
16 hours ago, alank2 said:Are you saying you replaced the background TButtonStyleObject with a TRectangle?
Yes, acting so even if you change stylebook at run time this custom style is independent
16 hours ago, alank2 said:Can the bitmap graphics that NormalLink points to be edited?
Yes, even if it's not so easy, you have to change about three PNG images (dpi necessity) . I remember a video by Sarina Dupont about using Adobe and Stencils to change colors
(see this tool) sorry, I don't found the link
and many others interventions (videos, blogs) about bitmap designer tool
Basically, using bitmap designer tool : save image
, edit images with whatever tool you have, and then return to bitmap designer, load the new image (hoping this should not change regions defined, I never check this)
Yes, you should say : "but bitmap designer is for VCL" (VSF file) but it's easy to save it as a FMX style
16 hours ago, alank2 said:What if I wanted to add something to that bitmap?
I guess increasing the size of the image, putting the desired drawing outside the already defined areas will do the trick
-
Well, it's FMX, so you can change the style (creating a custom one or modifying existent)
Here I delete initial background, put a TRectangle (aligned contents), sending it background (control/background) and set property stylename to background too.
Advantage you can "easily" change color of a Trectangle.
Inconvenient :
- if you want to use all other buttonstyles, you have to do the same thing !
- if you use dark colors, take care of the fontcolor
Notice, same as always, if you use it for all platforms change default style not the "Windows" default one
-
Hi, thanks.
UseLastKnownVersion is/was checked (by the way it's the 3.10.2)I was not aware of this property, unchecking it raise an "could not open Dll "python310.dll" exception (always and only on 32 bits)
-
-
Hi, this "bug" is corrected in version 11 (and perhaps 10.4, I don't check that)
- 1
-
Hi, first you have to install the two versions of PostgreSQL (32 and 64) the first for the IDE the second when running/debugging 64 apps
On the other hand, at runtime you can change library path (before connecting ) for this you need to put a FDPhysPgDriverLink (give it a DriverID, id to be used by FDConnection)
and then you will be able to change Vendorlib
- 1
-
Hi, in my application I offer to the user the possibility to change style (light/dark)
procedure TStartForm.SwitchThemeSwitch(Sender: TObject); begin Datas.StyleBookLight.UseStyleManager:=false; Datas.StyleBookDark.UseStyleManager:=false; if SwitchTheme.IsChecked then MainForm.StyleBook:=Datas.StyleBookDark else MainForm.StyleBook:=Datas.StyleBookLight; datas.parametres.blacktheme:=SwitchTheme.IsChecked; Datas.StyleBookLight.UseStyleManager:=not SwitchTheme.IsChecked; Datas.StyleBookDark.UseStyleManager:=SwitchTheme.IsChecked; {TODO -obug -cGeneral : TListview style don't apply on first lines} end;
All is working except on my TListView, as you can see. Here I change from light to dark, font text color is still black on these lines, scrolling down the color is the "normal" white
I remember I bang this bug another times, I override this by deactivating and then reactivating the link, but this is time-consuming when there are many records!
Is there another way ?
-
Thanks, I was looking for an error in the bad unit !
-
50 minutes ago, Anders Melander said:You haven't shown how you're handling the bitmap returned from ConvertToGrayscale
Sorry, I tried to edit my first message but don't work
procedure TfrmMain.btnGriserClick(Sender: TObject); begin if OpenDialog1.Execute then begin Image1.Bitmap.LoadFromFile(OpenDialog1.FileName); image2.Bitmap:= ConvertToGrayscale(image1.Bitmap); // image3.Bitmap:= ConvertToGrayscale(image1.Bitmap,TAlgorithm.algluminosity); // image4.Bitmap:= ConvertToGrayscale(image1.Bitmap,TAlgorithm.algaverage); // image5.Bitmap:= ConvertToGrayscale(image1.Bitmap,TAlgorithm.alglightness); end; end;
result
54 minutes ago, Anders Melander said:Apart from that your grayscale algorithm is horribly inefficient (and wrong).
Well, I try this ones
// https://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/
-
HI, I wrote this unit to grayscale an image
unit ImageUtils; interface uses System.SysUtils, System.UITypes, System.UIConsts , System.Math, FMX.Types, FMX.Graphics, FMX.Utils; type Talgorithm = (algnone,algluminosity,algaverage,alglightness); function ConvertToGrayscale(const aBitmap: TBitmap; const aMethod : TAlgorithm=algnone) : TBitmap; overload; function ConvertToGrayscale(const FileName : String; const aMethod : TAlgorithm=algnone) : TBitmap; overload; implementation function Colortogray(const aColor : Talphacolor; const aAlgo : TAlgorithm=algnone) : Talphacolor; var H,S,L : Single; C : TAlphacolorRec; // https://www.johndcook.com/blog/2009/08/24/algorithms-convert-color-grayscale/ begin RGBToHSL(aColor,H,S,L); c.Color:=acolor; case aAlgo of algluminosity: begin H:=Trunc(0.2126*c.R) + Trunc(0.7152*c.G) + Trunc(0.0722*C.B); Exit(HSLToRGB(H,S,L)); end; algaverage: begin var mean : integer := (c.R + c.G + c.B) div 3; c.R:=mean; c.G:=mean; c.B:=mean; Exit(c.Color); end; alglightness: begin H:=(maxvalue([TAlphacolorRec(aColor).R,TAlphacolorRec(aColor).G,TAlphacolorRec(aColor).B]) + minvalue([TAlphacolorRec(aColor).R,TAlphacolorRec(aColor).G,TAlphacolorRec(aColor).B])) / 2; Exit(HSLToRGB(H,S,L)); end; else Exit(HSLtoRGB(0,0, L)); end; end; function ConvertToGrayscale(const aBitmap: TBitmap; const aMethod : TAlgorithm=algnone): TBitmap; var X, Y: Integer; bd1, bd2: TBitmapData; p1, p2: PAlphaColorArray; begin Result := TBitmap.Create(Round(aBitmap.Width), Round(aBitmap.Height)); if (aBitmap.Map(TMapAccess.Read, bd1) and Result.Map(TMapAccess.Write, bd2)) then begin try for Y := 0 to (aBitmap.Height - 1) do begin p1 := PAlphaColorArray(bd1.GetScanline(Y)); p2 := PAlphaColorArray(bd2.GetScanline(Y)); for X := 0 to (aBitmap.Width - 1) do begin p2[X] := Colortogray(p1[X],aMethod); end; end; finally aBitmap.Unmap(bd1); Result.Unmap(bd2); end; end; end; function ConvertToGrayscale(const FileName : String; const aMethod : TAlgorithm=algnone): TBitmap; var X, Y: Integer; bd1, bd2: TBitmapData; p1, p2: PAlphaColorArray; Source : TBitmap; begin Source:=TBitmap.Create; try Source.LoadFromFile(FileName); Result := TBitmap.Create(Round(Source.Width), Round(Source.Height)); if (Source.Map(TMapAccess.Read, bd1) and Result.Map(TMapAccess.Write, bd2)) then begin try for Y := 0 to (Source.Height - 1) do begin p1 := PAlphaColorArray(bd1.GetScanline(Y)); p2 := PAlphaColorArray(bd2.GetScanline(Y)); for X := 0 to (Source.Width - 1) do begin p2[X] := Colortogray(p1[X],aMethod); end; end; finally Source.Unmap(bd1); Result.Unmap(bd2); Source.Free; end; end; except Source.Free; result:=nil; end; end; end.
But I don't understand where I miss something because I have some memoryleaks
---------------------------
Unexpected Memory Leak
---------------------------
An unexpected memory leak has occurred. The unexpected small block leaks are:29 - 36 bytes: TD2DBitmapHandle x 1, TBitmapImage x 1
45 - 52 bytes: TBitmap x 1
61 - 68 bytes: Unknown x 1
---------------------------
OK
--------------------------- -
Hi, and happy new year.
As far as I know about Firebird the system tables are prefixed MON$, RDB$ and (SEC$ starting with FB 3.0) not TMP$
to get privilege(s) on a table you can use
select RDB$USER,LIST(RDB$PRIVILEGE) from rdb$user_privileges where RDB$RELATION_NAME=<tablename> GROUP BY 1
but some fields can be involved too so in this "list" you can find some repetitions
Here is the result of a
SELECT a.RDB$USER, a.RDB$RELATION_NAME,-- a.RDB$FIELD_NAME, LIST(a.RDB$PRIVILEGE) RIGHTS FROM RDB$USER_PRIVILEGES a WHERE a.RDB$RELATION_NAME='LLANCEMENT' GROUP BY 1,2;
QuoteRDB$USER RDB$RELATION_NAME RIGHTS
FOURNISSEUR LLANCEMENT S ,U ,U ,U ,U ,U ,U ,U ,U ,U ,U ,U ,U
SYSDBA LLANCEMENT D ,I ,R ,S ,U
USINE LLANCEMENT S ,U ,U ,U ,U ,U ,U ,U ,U ,U ,U ,UBut this don't give the "reality" of the rights user FOURNISSEUR (supplier) don't have the same field access than USINE (factory)
QuoteRDB$USER RDB$RELATION_NAME RDB$FIELD_NAME RIGHTS
FOURNISSEUR LLANCEMENT [null] S
FOURNISSEUR LLANCEMENT COLIS U
FOURNISSEUR LLANCEMENT COMPLEMENT U
FOURNISSEUR LLANCEMENT DATE_DEPART U
FOURNISSEUR LLANCEMENT DATE_DEPART1TIMESTAMP U
FOURNISSEUR LLANCEMENT DATE_DEPART2 U
FOURNISSEUR LLANCEMENT DATE_DEPART2TIMESTAMP U
FOURNISSEUR LLANCEMENT DATE_DEPART3 U
FOURNISSEUR LLANCEMENT DATE_DEPART3TIMESTAMP U
FOURNISSEUR LLANCEMENT DATE_LIV U
FOURNISSEUR LLANCEMENT LAST_MODIF U
FOURNISSEUR LLANCEMENT NOTE2 U
FOURNISSEUR LLANCEMENT REMARQUE U
SYSDBA LLANCEMENT [null] D ,I ,R ,S ,U
USINE LLANCEMENT [null] S
USINE LLANCEMENT COMPLEMENT U
USINE LLANCEMENT DATE_DEPART U
USINE LLANCEMENT DATE_DEPART1TIMESTAMP U
USINE LLANCEMENT DATE_DEPART2 U
USINE LLANCEMENT DATE_DEPART2TIMESTAMP U
USINE LLANCEMENT DATE_DEPART3 U
USINE LLANCEMENT DATE_DEPART3TIMESTAMP U
USINE LLANCEMENT FIN_FABS U
USINE LLANCEMENT LAST_MODIF U
USINE LLANCEMENT NOTE1 U
USINE LLANCEMENT REMARQUE UAnd take in mind you can change ROLE.
I never really looked into the possibility of changing the access to the editing areas of a shape from the rights declared in a Firebird database, Interesting challenge for my future retirement
-
1 hour ago, emileverh said:Batchmove
FDBatchmove, yes a good tool and if it is a one shot operation you don't need to run the program you can make all your ops during design time, changing tables or querys and using context menu to run it
but at runtime with these conditions
QuoteThe datamodel is for both exact(!) the same on logical level, so all the indexes, foreign keys and constraints are the same. The model contains about 70 tables.
should be esay too
-
1 hour ago, Frickler said:FireDAC doesn't support Paradox at all.
I don't agree you can use ADO driver, even if I agree with your second remark
QuoteYou have to port to another Database,
Not necessarily Firebird : Paradox = Mon User so SQLite is sufficient
1 hour ago, Frickler said:no more SetRange and Filter,
FDTable have these functions, personally I prefer FDQuery but ...
-
WITH dt2 AS ( select goods_id, sum(qty) as inc, cast(0 as float) as sale, cast(0 as float) as writeoff from income where cast(recdate as date) <= :d group by goods_id union all select goods_id, cast(0 as float), sum(qty) as sale, cast(0 as float) from sales where cast(recdate as date) <= :d group by goods_id union all select goods_id, cast(0 as float), cast(0 as float), sum(Qty) as writeoff, from writeoff where cast(recdate as date) <= :d group by w.goods_id) ) select G.Goods, G.Goods_id, coalesce(dt2.incomes,0)as incomes, coalesce(dt2.sales,0) as sales, coalesce(dt2.writeoffs,0) as writeoffs, coalesce(dt2.endqnts,0) as endqnts From Goods G JOIN dt2 on G.Goods_id=dt2.Goods_id on G.Goods_id=dt2.Goods_id order by G.Goods
I think that, if CTE is really effective in Interbase 2020, this one is more clear
Some notes :
- Using alias in a union is not useful
- I change the where clause in the last part of the union : where cast(recdate as date) <=:d ( hoping that this column exists in the table "writeoff")
Question the JOIN between Goods and dt2, it shouldn't rather be a LEFT JOIN
- 1
-
You spoke about Database Desktop not Delphi 7, I am confused 😲
D7 works on Windows 10, I install/uninstall it about once a month
-
11 hours ago, audi30tdi said:Database Desktop
You mean DBD32.Exe and the 2 errors about directories?
Well, I don't use, it but you have to know some clues
The location of the BDE "Working" and "Private" directories are stored in HKEY_CURRENT_USER\Software\Borland\DBD\7.0\Configuration\WorkDir and HKEY_CURRENT_USER\Software\Borland\DBD\7.0\Configuration\PrivDir respectively. Each directory default value stores the data containing
So my first suggestion is to check this.
Other solution is to install D7 with the same hints as BDE (but you will get some trouble with coexistence, I ran into during a demo, TClientDataset) and use the DBD32.exe of this version.
But, I have a doubt, if you need this old program, did you mean that you still use Paradox/DBase tables?
-
22 hours ago, Serge_G said:You have to go on your registered product portal and download BDE for your version.
But BDE 5.2.0.2 is one of the last versions (remember deprecated for 20 years an not updated)
44 minutes ago, audi30tdi said:that I can't install in Win10
It's easy to install BDE on Win 10 if you respect some hints.
- don't install in the default directory (c:\progran files (x86)) but in a non-secured by UAC windows directory
- run BDEAdmin as administrator
- change NETDIR of paradox (see picture, from my w10 pc)
- change memory size and address (depending on tour computer)
- save IDAPI32.CFG to a non-secured by UAC windows directory and confirm it should be the default configuration file
dialog when you exit BDE
Even so, you will run into some problems from time to time (I suspect windows update)
By the way, it's first time I check my version is
- 1
-
29 minutes ago, audi30tdi said:Is FireDAC included with the latest Delphi version??
Yes
You have a tool to migrate from BDE Components to Firedac ones : "refind" (C:\Users\Public\Documents\Embarcadero\Studio\22.0\Samples\Object Pascal\Database\FireDAC\Tool\reFind)
You will find some step to step migration in docwiki (https://docwiki.embarcadero.com/RADStudio/Sydney/en/ReFind.exe,_the_Search_and_Replace_Utility_Using_Perl_RegEx_Expressions)
But, before this, you have to go on your registered product portal and download BDE for your version.
By experience even if it works, I prefer to create new Firedac components (connection, table and query) because Firedac is more powerful than BDE (i.e. macros)
-
18 hours ago, Frickler said:With Update 2, Interbase 2020 has now CTEs.
Well, in fact Interbase 2017 had non recursive CTE possiblities (named derived table)
Good news to have now recursive ones, and can we expect in a near future, windows functions?
Is anyone using IBX (Interbase Express) and compatibility question
in Databases
Posted
Agree 100%