Board index » delphi » EAdoError doesn't return error when error occurrs after normally completed procedure

EAdoError doesn't return error when error occurrs after normally completed procedure

I use MS SQL Server 7, Delphi 5 and ADO components. When I try to execute
AdoCommand which consists of transaction with several stored procedures and
first procedure is normally completed but there is an error in a second
one - nothing is happend with AdoError. But if error occurrs in a first
procedure - AdoError returns an error code.

example code

AdoCommand.CommandText:="exec SPTest1 ..... exec SPTest2 ......"
try
    AdoCommand.execute
exeption
    on e:EAdoError
    do ShowMessage(e.message)
end

 

Re:EAdoError doesn't return error when error occurrs after normally completed procedure


Quote
>one - nothing is happend with AdoError. But if error occurrs in a first
>procedure - AdoError returns an error code.

Examine the AdoConnection.errors property.

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

Re:EAdoError doesn't return error when error occurrs after normally completed procedure


Thanks for your answer!
But could you please send an example of what you mean, because I'm not
clearly understand error collection.

Thanks in advance.
Alexander Kournitsky.

Brian Bushay TeamB <BBus...@Nmpls.com> ??? a
????:hp12lt08n8elc9elhqbvbfk5tvumur2...@4ax.com...

Quote

> >one - nothing is happend with AdoError. But if error occurrs in a first
> >procedure - AdoError returns an error code.

> Examine the AdoConnection.errors property.

> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Re:EAdoError doesn't return error when error occurrs after normally completed procedure


Quote
>Thanks for your answer!
>But could you please send an example of what you mean, because I'm not
>clearly understand error collection.

Did you look at the TadoConnection.errors property in help?

here is an example for getting at the information in the errors collection

  For i:=0 To ADOConnection.Errors.Count-1 Do Begin
      isource:= ADOConnection.Errors[i].Source;
      stDesc:= ADOConnection.Errors[i].Description ;
      iState:= ADOConnection.Errors[i].SQLState;
   End;//For

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

Re:EAdoError doesn't return error when error occurrs after normally completed procedure


Another thing to check is that the system and user regional locale settings
are the same.
If they are not, the error you get back will be just an OLE code.

regards

Dan

"Brian Bushay TeamB" <BBus...@Nmpls.com> wrote in message
news:9lg4lt8pogvb1f66814ha4jc9grk0d6ai9@4ax.com...

Quote
> >Thanks for your answer!
> >But could you please send an example of what you mean, because I'm not
> >clearly understand error collection.

> Did you look at the TadoConnection.errors property in help?

> here is an example for getting at the information in the errors collection

>   For i:=0 To ADOConnection.Errors.Count-1 Do Begin
>       isource:= ADOConnection.Errors[i].Source;
>       stDesc:= ADOConnection.Errors[i].Description ;
>       iState:= ADOConnection.Errors[i].SQLState;
>    End;//For

> --
> Brian Bushay (TeamB)
> Bbus...@NMPLS.com

Other Threads