_RecordsetPtr p;
//int iCount = p->Fields->GetCount ();p->Fields->Count;
long iCount = p->Fields->GetCount ();p->Fields->Count;
//p->Fields->GetItem ( );
//p->GetFields()->GetItem (0)->GetValue ();
//p->GetFields()->GetItem (0)->Value;
for ( int i = 0 ; i < iCount ; i++ ) 
{
  _bstr_t bstr ("");
  bstr = p->GetFields()->GetItem (i)->Name;
    //Here you may need to convert i to _variant_
}