Long shot this one, but anyone know of some way to prevent data-aware components from trying to resolve column names and similar at design time? We're using dbExpress.
Long shot this one, but anyone know of some way to prevent data-aware components from trying to resolve column names and similar at design time? We're using dbExpress.
We don't have our connections set up at design time, so this is a big annoyance, having to dismiss error dialogs left right and center.
We don't have our connections set up at design time, so this is a big annoyance, having to dismiss error dialogs left right and center.
This tells me you're not using DevExpress components!
ReplyDeleteOr you wouldn't have the problem!
A
One of the ways to solve this is to create persistent fields at design time where possible. This would solve the problem for the most part. It'd still be annoying for those cases where you can't, but hey!
ReplyDeleteA
Andrea Raimondi We are using DevExpress and they're doing exactly the same thing.
ReplyDeleteCreating persistent fields would be tedious. Also a lot more places to change... and thus forget to change.
In fact I was adding some new columns to a DevExpress grid which made me rage and post this question just now.
ReplyDeleteUhm, that's not my experience at all, but then, I use persistent fields lol :)
ReplyDeleteWell... "use"... I have them to make sure to be able to select them from the OI :)
But hey, that's just me!
A
Andrea Raimondi That probably explains it then.
ReplyDeleteAs I said, it seems to me persistent fields would make the application more brittle as you have to update them if you make any changes to the database schema.
Design with connections .Active set to false?
ReplyDeleteLars Fosdal that's not guaranteed to work because the Delphi IDE might try to start it - I've seen that happen.
ReplyDeleteA
I can't remember seeing that - unless there is some home written code that doesn't check for design mode. Then again - we do most of our UI plumbing in code.
ReplyDeleteLars Fosdal Yes that's what we do. The data-aware components then try to connect, which of course fails because connection details are provided from the outside at runtime.
ReplyDeleteAnd yeah, this product has a long history. I know there are better ways of doing things ;)
ReplyDeletePersistent fields are not that brittle. You can add columns to the underlying DB tables and make minor changes to them without breaking the field layout. I'm not sure about dbExpress, but in MyDAC its only a couple keyboard-shortcut keystrokes to autocreate all of the field definitions for a query or other DB component.
ReplyDeletePersonally, I find persistent fields very useful if used correctly (obviously!!).
ReplyDeleteF.i. using the DevExpress components, if you mark a field as not visible, adding the columns in the grid will notice that and not add the inviisble ones.
I also sometimes use the DisplayLabel for validation: if I need to validate the dataset instead of the control (for instance because I am using controls that have no way to
check the actual data, unlike DevExpress), the display label comes in really useful to display the field name (provided you're smart and your label on screen
matches the DisplayLabel property).
Kind Regards,
A