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.

Comments

  1. This tells me you're not using DevExpress components!
    Or you wouldn't have the problem!

    A

    ReplyDelete
  2. 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!

    A

    ReplyDelete
  3. Andrea Raimondi We are using DevExpress and they're doing exactly the same thing.


    Creating persistent fields would be tedious. Also a lot more places to change... and thus forget to change.

    ReplyDelete
  4. In fact I was adding some new columns to a DevExpress grid which made me rage and post this question just now.

    ReplyDelete
  5. Uhm, that's not my experience at all, but then, I use persistent fields lol :)
    Well... "use"... I have them to make sure to be able to select them from the OI :)

    But hey, that's just me!

    A

    ReplyDelete
  6. Andrea Raimondi That probably explains it then.

    As 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.

    ReplyDelete
  7. Design with connections .Active set to false?

    ReplyDelete
  8. Lars Fosdal  that's not guaranteed to work because the Delphi IDE might try to start it - I've seen that happen.

    A

    ReplyDelete
  9. 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.

    ReplyDelete
  10. Lars 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.

    ReplyDelete
  11. And yeah, this product has a long history. I know there are better ways of doing things ;)

    ReplyDelete
  12. Persistent 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.

    ReplyDelete
  13. Personally, I find persistent fields very useful if used correctly (obviously!!).
    F.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

    ReplyDelete

Post a Comment