ADO Error codes...

Hi,

I have another question about ADO (using C++). I have searched the MSDN but I haven't found a answer to my question (maybe I'm just too stupid)... If I make a connection to my SQL Server there may occur some errors, but how to find out what went wrong

In terms of code I have e.g. something like that:
try
{
connection->Open(ConnectionString,Username,Password,ADODB::adConnectUnspecified);
...
}
catch (_com_error& e)
{
long numErrors = connection->Errors->Count;
for (long i=0; i<numErrors; i++)
{
ADODB::ErrorPtr pErr = connection->Errors->GetItem(i);
.....
}
}

Now I could get the error number by pErr->GetNumber().
But with which symbolic constant has this to be compared to find out which error occured I didn't find any...Or is there another better way to do this

P.S. I am using SQL Server 2005 Express



Answer this question

ADO Error codes...