怎样得到某一数据库表中某一字段的最大值?
VC++操作数据库得到某一数据库表中某一字段的最大值:
_ConnectionPtr pConnection;
_RecordsetPtr pRecordset;
_CommandPtr pCommand;
CString strSQL=_T("SELECT max(Section) FROM table");
_variant_t fieldCount;
VariantInit (&fieldCount);
pCommand->CommandType =adCmdText;
pCommand ->CommandText =(_bstr_t)strSQL;
pRecordset= pCommand->Execute (&fieldCount,NULL,adCmdUnknown);
怎样才能把该最大值得出来?往下该如何做?