I want to be able to run a procedure both on the 'OnCreate' and 'OnDestroy' event of my various datamodules in my applications. At the moment on destroy of the application I have a procedure which checks the state of a dataset - if it is one of the edit modes then a 'Cancel' is performed - then the table/query has Active set to False to ensure that no data connections are open when we destroy the datamodule. This procedure has to be called for each of the table/query components in the datamodule in a list maintained by the developer. Is there a procedure that anyone uses that can be run to step through the query components (or table components) closing them - without me having to run a procedure for each and every data component listed by myself.
I sometimes have data components (query or tables) open in the design environment but want these to be closed when the application is started by the user - so need to run a similar procedure 'OnCreate' of the datamodule - such that all tables/querys are stepped through and have Active set to False to ensure no data is being accessed at start up.
Can anyone provide me with a solution or any pointers to get me started ??
Thanks in advance.
Steve
I sometimes have data components (query or tables) open in the design environment but want these to be closed when the application is started by the user - so need to run a similar procedure 'OnCreate' of the datamodule - such that all tables/querys are stepped through and have Active set to False to ensure no data is being accessed at start up.
Can anyone provide me with a solution or any pointers to get me started ??
Thanks in advance.
Steve