4,012
社区成员
发帖
与我相关
我的任务
分享
_stprintf_s(szQuery, _countof(szQuery), TEXT("select id_usernum, id_idcard,id_name from userinfo where id_idcard='%s'"), szidCard);
try
{
AdoRst = AdoConn->Execute(szQuery, NULL, adConnectUnspecified);
}catch(_com_error &e)
{
MessageBox(e.Description(), e.ErrorMessage(), MB_ICONERROR);
CoUninitialize();
return;
}
CString s;
try
{
for (long i=0; i<AdoRst->Fields->Count; i++)
{
s.Format(TEXT("字段%d:%s"), i, (TCHAR*)AdoRst->Fields->Item[i]->Name);
MessageBox(s);
}
}
catch(_com_error &e)
{
MessageBox(e.Description(), e.ErrorMessage());
}