-

 - e-mail

 

 -

   xpackpackax

 -

 LiveInternet.ru:
: 09.01.2009
:
:
: 1835

:


EDBEngineError

, 06 2009 . 22:52 +
, BDE, EDBEngineError. EDBEngineError try..except. EDBEngineError EDBEngineError, . . "" .

, :
ErrorCount: Integer; Errors; .
Errors: TDBError; , ; , Integer.
Errors.ErrorCode: DBIResult; BDE Errors.
Errors.Category: Byte; , ErrorCode.
Errors.SubCode: Byte; ErrorCode.
Errors.NativeError: LongInt; , ; , ; SQL.
Errors.Message: TMessageStr; , Errors; , BDE.
try..except, EDBEngineError except. , . EDBEngineError , , . , ; . DBEngineError, .

try..except DBEngineError , :
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
if Edit1.Text > ' ' then
begin
Table1.FieldByName('Number').AsInteger := StrToInt(Edit1.Text);
try
Table1.Post;
except
on E: EDBEngineError do
ShowError(E);
end;
end;
end;



Post TTable. try..except. EDBEngineError, except, EDBEngineError (E) ShowError. , EDBEngineError. .

ShowError EDBEngineError "" . TMemo. , , , . . ErrorCounnt. Integer , , . ErrorCount- ( , - Errors), "" TMemo.
procedure TForm1.ShowError(AExc: EDBEngineError);
var
i: Integer;
begin
Memo1.Lines.Clear;
Memo1.Lines.Add(' : ' + IntToStr(AExc.ErrorCount));
Memo1.Lines.Add('');
{ Errors}
for i := 0 to AExc.ErrorCount - 1 do
begin
Memo1.Lines.Add(': ' + AExc.Errors[i].Message);
Memo1.Lines.Add(' : ' +
IntToStr(AExc.Errors[i].Category));
Memo1.Lines.Add(' : ' +
IntToStr(AExc.Errors[i].ErrorCode));
Memo1.Lines.Add(' : ' +
IntTooStr(AExc.Errors[i].SubCode));
Memo1.Lines.Add(' : ' +
IntToStr(AExc.Errors[i].NativeError));
Memo1.Lines.Add('');
end;
end;

: [1] []
 

:
: 

: ( )

:

  URL