Page 1 of 1

SDAC Ole db error listing

Posted: Tue 01 Feb 2011 16:39
by dpoulin
I'm looking for a listing of possible error number with the error message from SDAC which can be show in my program.
Something which could look like this:
0x80040E4D -2147217843 Authentication failed

I d'like to change some error message to be more friendly for the user. So if I could have the whole list, I could figure which one I should change before the user sees it.
I'm pretty sure the message error comes from SDAC and not oledb.
Error number comes from Oledb. I might be wrong...
If the whole thing comes from OleDb, where could I find an accurate list for sql server 2008 ?

Posted: Wed 02 Feb 2011 10:15
by AlexP
Hello,

We have got the text and the code of the error from OLEDB.

You can view the full list of errors by executing the following query:

Code: Select all

select * from sys.messages;
and use the following code to show your own message, for example:

Code: Select all

uses OleDBAccess;

........

try
    Connect;
except
  on E:EMSError do
    case e.MSSQLErrorCode of
      XXXX: ShowMessage('');
      YYYYY: ShowMessage('');
    end;
end;

Posted: Fri 04 Feb 2011 13:41
by dpoulin
Great !! Exactly what I needed :D

Posted: Fri 04 Feb 2011 14:04
by AlexP
Hello,

It is good to see that this problem was solved. If any other questions come up, please contact us.