Recent

Author Topic: Best practice for Data Component management in multiform app  (Read 3989 times)

seaton

  • New Member
  • *
  • Posts: 48
Best practice for Data Component management in multiform app
« on: January 24, 2011, 01:40:24 pm »
G'Day one and all,

I'm using the zeos database components and SQLite in a multiform sqlite database app, however I'm finding that the management of them in all the forms is becoming a chore, especially setting the database location in each TzConnection.

Each form has a TZConnection, then a number of TzTables, and DataSources.  Am I better off setting a single TzConnection on the main form then keeping the TzTables and datasources on the relevant forms?

Regards,

Stephen...

garlar27

  • Hero Member
  • *****
  • Posts: 622
Re: Best practice for Data Component management in multiform app
« Reply #1 on: January 24, 2011, 03:17:33 pm »
You can use a TDataModule to contain your Connection, and some tables, querys or what ever you may need.

You can add a TDataModule by choosing menu: "File/New.." then pick "Data Module" from the "Module" branch and click OK

seaton

  • New Member
  • *
  • Posts: 48
Re: Best practice for Data Component management in multiform app
« Reply #2 on: January 25, 2011, 04:36:53 am »
Thanks for that, this will definately resolve the problem. As a newb I didn't know they existed :-[  Many thanks.