Board index » delphi » Table events vs Datasource event: have I sinned?

Table events vs Datasource event: have I sinned?

I put all tables and datasources in the datamodule.  I am updating
controls on forms from the table events (BeforeInsert, etc.).  (I knew
this was not quite right but I didn't know how else to do it.)

I'm wondering if I should have done it this way instead:

- Put tables in one datamodule.

- Put datasources in the forms.  Use the datasource's OnStateChange with
a case statement (to break out the states) to update the controls on the
form.

 

Re:Table events vs Datasource event: have I sinned?


Quote
>I put all tables and datasources in the datamodule.  I am updating
>controls on forms from the table events (BeforeInsert, etc.).  (I knew
>this was not quite right but I didn't know how else to do it.)

>I'm wondering if I should have done it this way instead:

I will often put a custom event handler in the form initializing it in the
Arrive event and setting it back on depart.

like
dm.myTalbe.BeforePost := mtableCusomBeforePost

--
Brian Bushay (TeamB)
Bbus...@DataGuidance.com

Other Threads