Board index » delphi » DisableControls generats Exception

DisableControls generats Exception

Hi,

I want to avoid that the user can access or change data before
clicking the EditButton. So I work with Table/Query.DisableControls
and EnableControls.

But when using this method in the FormActivateProcedure, two
Exceptions 'EAccessViolation' are generated when leaving the program.

The program itself works fine - but I mean its no proper solution.

Thanks in advance

Harald

 

Re:DisableControls generats Exception


I know this problem, it appears in one of my Programms too.
Seems, that the FormActivateProcedure allso been called, when the programm
will be closed.
I solved this problem like this:

in the interface part, i declared a variable called :Databaseready as a
boolean.
Then after the Tables/Querys are successfull opened, a set it too true,
before closing them in the OnClose/OnClosequery-Procedure i set it to false.
Now, befor every Databasecall, i check this boolean, if the Database is
ready, and the problem has solved.

Harald Berdel schrieb in Nachricht <6tt0s0$th...@news01.btx.dtag.de>...

Quote
>Hi,

>I want to avoid that the user can access or change data before
>clicking the EditButton. So I work with Table/Query.DisableControls
>and EnableControls.

>But when using this method in the FormActivateProcedure, two
>Exceptions 'EAccessViolation' are generated when leaving the program.

>The program itself works fine - but I mean its no proper solution.

>Thanks in advance

>Harald

Other Threads