SDAC Ole db error listing

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
dpoulin
Posts: 13
Joined: Fri 14 Jan 2011 16:41

SDAC Ole db error listing

Post by dpoulin » Tue 01 Feb 2011 16:39

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 ?

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

Post by AlexP » Wed 02 Feb 2011 10:15

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;

dpoulin
Posts: 13
Joined: Fri 14 Jan 2011 16:41

Post by dpoulin » Fri 04 Feb 2011 13:41

Great !! Exactly what I needed :D

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

Post by AlexP » Fri 04 Feb 2011 14:04

Hello,

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

Post Reply