const LPCSTR STRING_CONNECTION = ..............
BOOL Conectar(_ConnectionPtr& pCone)
{
_bstr_t bstrCone(STRING_CONNECTION);
try
{
pCone.CreateInstance (__uuidof(Connection));
pCone->Open(bstrCone ,_bstr_t (""), _bstr_t (""), adModeUnknown );
return TRUE;
}
catch (_com_error& ce) { return FALSE; }
catch(...) { MessageBox(NULL,"Ah ocurrido otro error","Error",MB_OK);
return FALSE; }
}