matching db error errorcode

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
bedla.czech
Posts: 23
Joined: Wed 10 Aug 2005 09:10

matching db error errorcode

Post by bedla.czech » Sat 10 Sep 2005 12:37

Hi,

i have one problem, when handling OnDeleteError, OnEditError or OnPostError. In this event handlers i have this code:

Code: Select all

 EMyError *myError = (EMyError *)E;
 if ( myError )
  Memo1->Lines->Add("Error >["+ IntToStr( myError->ErrorCode )+"] "+myError->Message);
In documentation is written that in myError->ErrorCode is MySQL error code number, but when i check the MySQL documentation none of given error codes are matching :-( am i doing something wrong? can you help me :-)

Example: when selected record row is deleted and in other connection i am trying to edit this record row the OnEditError is fired and in myError->ErrorCode is 9997612 and in myError->Message is "Refresh failed. Found 0 records."
TMyQuery.RefreshOptions = [roAfterInsert, roAfterUpdate, roBeforeEdit]

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Sat 10 Sep 2005 13:25

Well I would say that in this case mysql isn't giving any error, but internal components are complaining. When you Post a record that's deleted by some other user/thread, basically internally it does a UPDATE table set xxx where xxxx , and afterwards mydac does a select of that record, in the case it's deleted it returns 0 records, and there's the complain/exception mydac gives. I think this is correct behaviour.

bedla.czech
Posts: 23
Joined: Wed 10 Aug 2005 09:10

Post by bedla.czech » Sat 10 Sep 2005 15:18

GEswin wrote:Well I would say that in this case mysql isn't giving any error, but internal components are complaining. When you Post a record that's deleted by some other user/thread, basically internally it does a UPDATE table set xxx where xxxx , and afterwards mydac does a select of that record, in the case it's deleted it returns 0 records, and there's the complain/exception mydac gives. I think this is correct behaviour.
yes, i thing too, but what does mean that strange numbers in myError->ErrorCode ?! None of them match MySQL documentation.

GEswin
Posts: 186
Joined: Wed 03 Nov 2004 16:57
Location: Spain
Contact:

Post by GEswin » Mon 12 Sep 2005 08:41

Well this should be answered by myDac/CrLab's people ;)

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Mon 12 Sep 2005 11:33

> In documentation is written that in myError->ErrorCode is MySQL error code
number

Please see mysqld_error.h from MySQL server

> trying to edit this record row the OnEditError is fired and in
> myError->ErrorCode is 9997612 and in myError->Message is "Refresh failed.
> Found 0 records."

This error is not MyError but EDatabaseError.

Post Reply