Ado Error Numbers

Ado Error Numbers

Post by F. Urtan E » Sat, 13 Sep 2003 16:55:09


Hi

I coldn't get error numbers, when an error occurs while an operation runs on
TAdoDataSet. My aim is to show error messages in my language. But it was
well working on TDataSet.

Ex:
//ERRBASE_LOCKCONFLICT + ERRCODE_LOCKED = DBIERR_LOCKED
if EDBEngineError(E).errors[0].errorcode = 10241 then begin
MessageDlg('Bu kay kullanor. lem yapamazs.',
mtInformation, [mbOK], 0);
Action := daAbort;
end;

How can I solve this problem.

Thanks.

F. Urtan Erdem
 
 
 

Ado Error Numbers

Post by F. Urtan E » Sat, 13 Sep 2003 20:49:06

I solved the problem.

When an error occurs, instead of gettin' TAdoDataSets error, I got
TAdoConnection's error. This is what I need.

try

...

except

...

adoconnection1.errors[0].nativeerror

End;

Error Codes are in "sql server books online", section "system error
messages".

Thanks.



>> Hi >> >> I coldn't get error numbers, when an error occurs while an operation runs
on >> TAdoDataSet. My aim is to show error messages in my language. But it was >> well working on TDataSet. >> >> Ex: >> //ERRBASE_LOCKCONFLICT + ERRCODE_LOCKED = DBIERR_LOCKED >> if EDBEngineError(E).errors[0].errorcode = 10241 then begin >> MessageDlg('Bu kay kullanor. lem yapamazs.', >> mtInformation, [mbOK], 0); >> Action := daAbort; >> end; >> >> How can I solve this problem. >> >> Thanks. >> >> F. Urtan Erdem >> >>