How to replace BDE error codes?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
lior
Posts: 36
Joined: Mon 01 Aug 2011 07:11

How to replace BDE error codes?

Post by lior » Mon 26 Sep 2011 14:59

Hello,
How would you replace these BDE error codes?

1)
procedure UpdateError1(Sender: TObject; DataSet: TCustomClientDataSet;
E: EUpdateError; UpdateKind: TUpdateKind; var Response: TResolverResponse);
Begin
If (UpdateKind=ukInsert)And(E.ErrorCode=9733) Then
Response:=rrIgnore; //9733=Master record missing
End;

2)
If E is EDBEngineError Then
If (EDBEngineError(E).Errors[0].ErrorCode = 9729) Then
// Key Violation

3)
If (E is EDBEngineError) Then
If (EDBEngineError(E).Errors[0].ErrorCode =
ERRBASE_OTHER + ERRCODE_UNKNOWNSQL) Then
//13056 + 3 = 13059

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 27 Sep 2011 09:34

Hello,

You can process these errors in the onUpdateError event of the TOraTable and TOraQuery components as in TDataSetProvider.

lior
Posts: 36
Joined: Mon 01 Aug 2011 07:11

Post by lior » Tue 27 Sep 2011 10:08

I was referring to the BDE error code. Is it the same as ODAC error code ? If EOraError(E).ErrorCode= number Then …
For example some BDE error codes I check:
9733 Master record missing
9729 Key Violation
13056 + 3 = 13059 ERRBASE_OTHER + ERRCODE_UNKNOWNSQL

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Tue 27 Sep 2011 15:37

Hello,

BDE and ODAC codes do not match, since ODAC returns an Oracle ORA-XXXXX error code in EOraError(E).ErrorCode, while BDE returns its own error codes.

Post Reply