Jump to content
JGMS

TFDPhysCommandKind contants missing in FireDAC Delphi 12

Recommended Posts

Integer constants as defined in "TFDPhysCommandKind" in unit 'FireDAC.Phys.Intf' in Delphi 11.3 and below, appear to be missing in Delphi 12.

 

TFDPhysCommandKind = (skUnknown, skSelect, skSelectForLock, skSelectForUnLock,
    skDelete, skInsert, skMerge, skUpdate, skCreate, skAlter, skDrop, skStoredProc,
    skStoredProcWithCrs, skStoredProcNoCrs, skExecute, skStartTransaction,
    skCommit, skRollback, skSet, skSetSchema, skOther, skNotResolved);

Does anybody know what has happened to them? Any idea where to find them?
Thanks ahead.

Share this post


Link to post

They have been renamed to TFDCommandKind, while TFDPhysCommandKind is a simple alias now.

Share this post


Link to post

Thank you @Uwe Raabe 

I preceded the respective constants in the code with 'TFDCommandKind." to overcome this problem.
I am surprised that the Delphi 12 requires the user to make code adjustments due to changes in the compiler. This is so unlike Delphi!
Another surpise that I face a problem due to changes in the BindNavigatorBeforeAction and BindNavigatorClick events: they fail because their parameters (Sender asTobject;  Button: TNavigateButton)  are no longer accepted!

In Delphi 11.3 my code runs flawless!

Might I ask whether you know what to do about this?

May thanks, Jan

Share this post


Link to post
24 minutes ago, JGMS said:

Another surpise that I face a problem due to changes in the BindNavigatorBeforeAction and BindNavigatorClick events: they fail because their parameters (Sender asTobject;  Button: TNavigateButton)  are no longer accepted!

Can you give a concrete (failing) example for that?

Share this post


Link to post

image.thumb.png.db926739f827a6c155a3d09d90414f7c.png

image.thumb.png.150c8a5e57408f83143f7ea8d1d47cfc.png

These are the error messages I got. In common: '...has an incompatible parameter list....

There are a number of TBindnavigators on the form connected to TStringGrids in an FMX 32 bits Windows application.

 

The events that are connected to the BindNavigators from within the Object Inspector are defined by

  procedure TForm1.BindNavigatorBeforeAction(Sender: TObject;  Button: TNavigateButton);

and

  procedure TForm1.BindNavigatorClick(Sender: TObject;  Button: TNavigateButton);


If I'd click 'Yes' I will loose the LiveBindings connections. I don't even want to think of that!

Share this post


Link to post

When I create an FMX application with a StringGrid and a BindNavigator with an Onclick event, the latter sets TBindNavigatebutton as parameter rather than TNavigateButton.
The former comes from the unit Fmx.Bind.Navigator and the latter from Data.Bind.Controls.

This leaves the question: is there a way to let the compiler accept both parameters?

Share this post


Link to post
1 hour ago, JGMS said:

is there a way to let the compiler accept both parameters?

Not that I am aware of.

 

Besides that, I really question the benefits of this declaration:

  TBindNavigateBtn = TNavigateButton;

 

Share this post


Link to post

I changed the parameter TNavigateButton to TBindNavigateBtn in both events, and I added FireDac.Stan.Intf to the unit clause to have TFDCommandKind constants like "skInsert" recognised. Problems solved.
Thanks for your help.

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×