catch(_com_error &e){
cout<<m_Rset->State;
::MessageBox(NULL,"Cant not Open the Table","Warning",MB_OK|MB_ICONWARNING);
}
try{
m_Rset->MoveFirst();
while(m_Rset->adoEOF==VARIANT_FALSE){
//retrieve column's value
string sname=(char*)(_bstr_t)(m_Rset->Fields->GetItem(_variant_t("name"))->Value);
int sage=(int)(m_Rset->Fields->GetItem(_variant_t("age"))->Value);
cout<<"sname :"<<sname<<" sage:"<<sage<<endl;
m_Rset->MoveNext();
}
}//try
catch(_com_error &e){
//CString str=(char*)e.Description();
::MessageBox(NULL,e.Description(),"Warning",MB_OK|MB_ICONWARNING);
}
m_con->Close();
m_Rset->Close();
return 0;
}
cout<<m_Rset->State;
::MessageBox(NULL,"Cant not Open the Table","Warning",MB_OK|MB_ICONWARNING);
}
try{
m_Rset->MoveFirst();
while(m_Rset->adoEOF==VARIANT_FALSE){
//retrieve column's value
string sname=(char*)(_bstr_t)(m_Rset->Fields->GetItem(_variant_t("name"))->Value);
int sage=(int)(m_Rset->Fields->GetItem(_variant_t("age"))->Value);
cout<<"sname :"<<sname<<" sage:"<<sage<<endl;
m_Rset->MoveNext();
}
}//try
catch(_com_error &e){
//CString str=(char*)e.Description();
::MessageBox(NULL,e.Description(),"Warning",MB_OK|MB_ICONWARNING);
}
m_con->Close();
m_Rset->Close();
return 0;
}