1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
|
wsprintf(szBuffer, "SELECT COUNT(*) FROM Cycles");
_variant_t Count;
_bstr_t bstc;
try
{
if(pRs->State != adStateClosed)
pRs->Close();
pRs->Open(szBuffer, _variant_t((IDispatch *) pConn, true), adOpenDynamic, adLockReadOnly, adCmdText);
}
catch(_com_error &e)
{
MessageBox(hwndDlg, e.Description(), "Erreur ExecuteRequete.", MB_ICONEXCLAMATION);
return FALSE;
}
if(pRs->EndOfFile)
return TRUE;
Count = pRs->GetFields()->GetCount();
Count = bstc;
if(Count.vt != VT_NULL)
{
Count = bstc;
lstrcpy(szBuffer, bstc);
SetWindowText(GetDlgItem(hwndDlg, IDC_EDITCOUNT), szBuffer);
} |
Partager