Jump to content
Der schöne Günther

FireDAC: Need help understanding "ConnectedStoredUsage"

Recommended Posts

So I have something very simple: A TFDConnection, a TFDTable, TDataSource and TDBGrid.

image.thumb.png.8b42152551e2654e947a7d828a99b079.png

 

Both connection and table have a property ConnectedStoredUsage

Quote

Controls how to use the Connected property value saved to the DFM.

The ConnectedStoredUsage property controls how to use the Connected property value saved to the DFM. Include:

  • auDesignTime, to use the property value at design time.
  • auRunTime, to use the property value at run time.

As far as I understand, I should be able to

  • Set both connection/table to "active"/"connected"
  • And remove the auDesignTime flag from the ConnectedStoredUsage property

so that the form designer will not connect to the database, but the running application will.

 

The problem is: Because both connection and table are not active on the form designer, their properties Connected = True and Active = True will not get saved into the DFM file!

 

Modifying the DFM file with notepad, adding "connected = true" and "active = true" yields exactly the result I'd expect: It will not connect on the form designer, but the running application will connect. As soon as I the form is modified within the IDE, it will once again remove the Connected = True and Active = True from the connection and table.

 

What am I missing? I'm sure this is not working as intended.

Share this post


Link to post

Such things are basically done programmatically. This will give you full control over them.

Share this post


Link to post

Of course, but I really wonder what this property is intended for. So far, it seems you cannot use it to achieve what it advertises and is therefore broken.

Share this post


Link to post

The statement in "docs" you referred to is blatantly super-non-verbose. Never use complex 3rd party lib w/o sources.

Share this post


Link to post

FireDAC sources do come with RAD Studio, what am I missing? 🤔

 

However, yes, the RAD Studio documentation in general is a pretty sad sight.

Share this post


Link to post

It works fine the opposite way - active at designtime and closed at runtime. I guess that most users use it that way. I allways make shure that all my queries are closed at programstart, and then open them via code. 

  • Like 1

Share this post


Link to post
Posted (edited)
16 hours ago, Hans J. Ellingsgaard said:

it works fine the opposite way - active at designtime and closed at runtime.

Yes, it does. But it indicates it also works the other way around, but it doesn't.

I think I'll file a bug report.

 

--

https://quality.embarcadero.com/browse/RSP-34216

Edited by Der schöne Günther
added link to bugtracker

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

×