Page 1 of 1

How to replace BDE error codes?

Posted: Mon 26 Sep 2011 14:59
by lior
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

Posted: Tue 27 Sep 2011 09:34
by AlexP
Hello,

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

Posted: Tue 27 Sep 2011 10:08
by lior
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

Posted: Tue 27 Sep 2011 15:37
by AlexP
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.