Board index » delphi » try in ApplyUpdates not work

try in ApplyUpdates not work

Hello I have code like:

procedure TDM_MKV.Q_TEMAfterPost(DataSet: TDataSet);
begin
 try
  DM_MAIN.dbPLAMA.ApplyUpdates([DM_MKV.Q_TEM]);
 except
 ShowMessage('Error !');
 end; //end try
end;

Ok. ShowMesage is shown on Error but I get also Error from ApplyUpdates. So
I get one error from try and showmessage from except.There must be only one
error shown from except and not from try.. I run exe program. What could be
wrong. I have delphi 4 service pack 2

Please help !

 

Re:try in ApplyUpdates not work


Matej -

Quote
>Hello I have code like:

>procedure TDM_MKV.Q_TEMAfterPost(DataSet: TDataSet);
>begin
> try
>  DM_MAIN.dbPLAMA.ApplyUpdates([DM_MKV.Q_TEM]);
> except
> ShowMessage('Error !');
> end; //end try
>end;

>Ok. ShowMesage is shown on Error but I get also Error from ApplyUpdates. So
>I get one error from try and showmessage from except.There must be only one
>error shown from except and not from try.. I run exe program. What could be
>wrong. I have delphi 4 service pack 2

Are you running in the development environment?  If so, you are
probably seeing the original error that a user of your application
wouldn't see.  If you don't want to see the error, then in
Tools/Environment Options/Preferences uncheck the "Break on exception"
checkbox.

--
Clayton Neff
Software Project Leader
The Personal Marketing Company, Inc.
11843 West 83rd Terrace
Lenexa, KS  66214
(913)492-0322
clay...@tpmco.com

Re:try in ApplyUpdates not work


 Try with events OnUpdateError. Whne you use ApplyUpdates you must use
OnUpdateError to handle exception. Take a look in help of applying record
in delphi   help

Matej Kavcic <matej.a.kav...@kiss.uni-lj.si> wrote in article
<01be2832$618785e0$a51f4...@MKV.belinka.si>...

Quote
> Hello I have code like:

> procedure TDM_MKV.Q_TEMAfterPost(DataSet: TDataSet);
> begin
>  try
>   DM_MAIN.dbPLAMA.ApplyUpdates([DM_MKV.Q_TEM]);
>  except
>  ShowMessage('Error !');
>  end; //end try
> end;

> Ok. ShowMesage is shown on Error but I get also Error from ApplyUpdates.
So
> I get one error from try and showmessage from except.There must be only
one
> error shown from except and not from try.. I run exe program. What could
be
> wrong. I have delphi 4 service pack 2

> Please help !

Re:try in ApplyUpdates not work


Perhaps you have "Stop on Delphi exceptions" enabled, which is just making
it look like two messages are appearing.

V/R
Russell L. Smith

Quote
Matej Kavcic wrote in message <01be2832$618785e0$a51f4...@MKV.belinka.si>...
>Ok. ShowMesage is shown on Error but I get also Error from ApplyUpdates. So
>I get one error from try and showmessage from except.There must be only one
>error shown from except and not from try.. I run exe program. What could be
>wrong. I have delphi 4 service pack 2

Other Threads